8

I have the following code:

MAPITable mt = rStores.MAPITable;

        Recordset rs = new Recordset();
        rs = mt.ExecSQL(@"SELECT EntryID, ""http://schemas.microsoft.com/mapi/proptag/0x0FF60102"" As PR_INSTANCE_KEY from Name");

        while (!rs.EOF)
        {
            var fields = ((dynamic)rs.Fields);
            for (int f = 0; f < fields.Count; f++)
            {
                var field = fields[f];
                var name = field.Name;
                var value = field.Value;
            }
            Debug.Print(rs.Fields["EntryID"].Value);
            Debug.Print(rs.Fields["PR_INSTANCE_KEY"].Value);
            rs.MoveNext();

When I try to access the recordset fields, I get the aforementioned error in the subject. I saw the question posted here, but that did not help me.

UPDATE: Nevermind - workaround listed here

Community
  • 1
  • 1
Larry G. Wapnitsky
  • 1,216
  • 2
  • 16
  • 35
  • 1
    Please answer your own question and mark it, so the question is cleared from the "unanswered questions" queue. Thanks! – Marc L. Oct 27 '11 at 02:22

1 Answers1

19

Unfortunately your link to the workaround is broken. Page Not found. I found the following workaround.

ADODB Properties from References: Embed Interop Types: false Copy local: true specific version (in English maybe isolated?): false

float
  • 1,265
  • 5
  • 22
  • 38
  • 2
    This was absolutely my problem - it was using a local version from the GAC instead of copying a stable version we had in a reference folder. Thanks. – Ducain Dec 03 '12 at 21:35