By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,358 Members | 2,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,358 IT Pros & Developers. It's quick & easy.

ADODB.Recordset.Fields.Update - Method not available

P: 69
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
Share this Question
Share on Google+
1 Reply


JKing
Expert 100+
P: 1,206
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.