Fields in recordset

J

JimS

(ADODB Recordset A2007 Open Dynamic)

If I open a simple recordset whose recordsource is another A2007 database,
change a field on a given record (x=y assignment), and then use that field
(x) before issuing any move, update, etc. methods, will that assignment be
valid? Will I be referencing whatever was in "y"? as opposed to what was in
"x"?
 
J

John Spencer

It depends.

If you mean:
myRecordset!X = 2

and later without moving off the record you have not save you refer to then
the new value will be returned. The old value has not been changed in the
table, but it has been changed in the recordset.

If you move off the record in the recordset without saving the change, then
move back to the record, the original value will now be in myRecordSet!X

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
D

Dirk Goldgar

John Spencer said:
If you move off the record in the recordset without saving the change,
then move back to the record, the original value will now be in
myRecordSet!X


While true for DAO, I think this is not true for ADO recordsets. IIRC, in
an ADO recordset, the .Update method is automatically called if you move off
an edited record without explicitly calling .Update or .CancelUpdate.
 

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

Top