Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem updating disconnected recordset with ADO

Status
Not open for further replies.

ptj

Programmer
Oct 5, 2001
46
GB
Anyone got any ideas - I believe this should work, but it doesn't - no errors though!!

I create a client-side recordset & disconnect it (all within a class-module - The recordset is created client side & passed by reference)

I add a few lines to the recordset.

I send the recordset (byref) back to the class-module where it reconnects to the database, sets the active connection to a valid connection & then batchupdates.

The problem is that changes in the recordset are not passed to the database. By stepping through the code, I can tell that the new lines in the recordset are definately getting to the class module, but when I step past the batchupdate, no error is given, but it doesn't change the database (SQL server 2000).

The recordset properties are

adUseClient
adOpenStatic
adLockBatchOptimistic

To disconnect I set the activeconnection = nothing & then set the connection=nothing

The connection is later reopened & the activeconnection set.

The new record matches the original SQL query string.

Aaagh help! Any ideas?

Thanks in anticipation,

Phil.
 
Sorry - seemed to have sorted the problem, but not sure how! I was using a different com object to read & update. Using the same one suddenly seems to have sorted the issue.

Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top