Can't call .update more than once?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

It appears that the other thread has died, so I'll try again:

I'm trying to switch providers from ODBC to OLEDB. One side-effect I have
found is that you cannot seem to call .update more than once on a newly added
row. Ie, this code will fail...

rstTemp.AddNew
rstTemp!notes = "this is a test"
rstTemp.Update
....
rstTemp!someOtherField = "some other test"
rstTemp.Update

This will cause an error on the .Update, "Identity cannot be determined for
newly inserted rows."

Has anyone seen this before? Is there some way to avoid it? Perhaps some
combination of locking flags or such?

Maury
 
The Update method saves the contents of the copy buffter to the recordset.
Once you've invoked it, you no longer have an active copy buffer.

In other words, don't issue the .Update until you've set all of the fields.
 
Douglas J. Steele said:
The Update method saves the contents of the copy buffter to the recordset.
Once you've invoked it, you no longer have an active copy buffer.

This did work before though, all I've changed is the provider.

My concern here is that this might not be the only instance of this in my
code, and I'd hate to have to find out the hard way.

Maury
 
While it is a little tedious, depending on how much code you have, you can
search the whole project for ".update" and review the code at each location.
Paul Shapiro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top