470,647 Members | 1,105 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

ADODB.Recordset.Fields.Update - Method not available

All,

I have a ADODB.Recordset in my Access 2002 project. I've been able to successfully add fields to the record set. According the the MS Access help files, I now must update the recordset to get the field additions to "stick." For example, the code below shows how the Access help files say to append fields to a ADO recordset.

Expand|Select|Wrap|Line Numbers
  1. dim ADO_RS as ADODB.Recordset
  2.  
  3. set ADO_RS = (some other ADODB recordset)
  4. ADO_RS.Close
  5. ADO_RS.Fields.Append  (Name), (Type), (Size)
  6. ADO_RS.Fields.Update
However, when I try to write the last line of code (above) in VB, I don't get the "Update" method as one of my autofill choices. If I just go ahead and type in "Update", when the code runs I get a compile error "Method or data member not found"

The Access help file says that "Update" is a valid method for the ADODB.Fields object, but the VB editor says it isn't. Even the Object Browser in the VB editor doesn't list "Update" and a valid object.

Is there a reference I'm missing? How can I get the field additions to the ADODB.Recordset to "stick"?

I've tried running my code without the update. When I put a watch on the recordset, I can see my fields getting added. But as soon as I use the Open method to begin adding data to the recordset, the fields I added disappear.

Thanks for your time and help,
Scott
Oct 5 '07 #1
1 9706
JKing
1,206 Expert 1GB
All,

I have a ADODB.Recordset in my Access 2002 project. I've been able to successfully add fields to the record set. According the the MS Access help files, I now must update the recordset to get the field additions to "stick." For example, the code below shows how the Access help files say to append fields to a ADO recordset.

Expand|Select|Wrap|Line Numbers
  1. dim ADO_RS as ADODB.Recordset
  2.  
  3. set ADO_RS = (some other ADODB recordset)
  4. ADO_RS.Close
  5. ADO_RS.Fields.Append  (Name), (Type), (Size)
  6. ADO_RS.Fields.Update
However, when I try to write the last line of code (above) in VB, I don't get the "Update" method as one of my autofill choices. If I just go ahead and type in "Update", when the code runs I get a compile error "Method or data member not found"

The Access help file says that "Update" is a valid method for the ADODB.Fields object, but the VB editor says it isn't. Even the Object Browser in the VB editor doesn't list "Update" and a valid object.

Is there a reference I'm missing? How can I get the field additions to the ADODB.Recordset to "stick"?

I've tried running my code without the update. When I put a watch on the recordset, I can see my fields getting added. But as soon as I use the Open method to begin adding data to the recordset, the fields I added disappear.

Thanks for your time and help,
Scott

Try this:

Expand|Select|Wrap|Line Numbers
  1. Dim ADO_RS As ADODB.Recordset
  2.  
  3. set ADO_RS = (some other ADODB recordset)
  4. ADO_RS.Close
  5. ADO_RS.Fields.Append  (Name), (Type), (Size)
  6. ADO_RS.Update
  7.  
Oct 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Dot Netizen | last post: by
reply views Thread by Channing Jones | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.