Fields in recordset

  • Thread starter Thread starter JimS
  • Start date Start date
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"?
 
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
 
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.
 
Back
Top