Access 2000

  • Thread starter Thread starter ABC
  • Start date Start date
A

ABC

Hi,
I am using Access 2000 as backend and VFP 5 as frontend.

Using SQLEXEC function to insert a row in access table.
This table has an AUTONUMBER field set to 'Increment'.

Now how to determine the value of this field for the newly
addedd record ?
Regards
 
This table has an AUTONUMBER field set to 'Increment'.

Now how to determine the value of this field for the newly
addedd record ?

Just about the only way to do this is with the DAO .AddNew method:


Set rs = db.OpenRecordset( _
"SELECT MyANField, MyRequiredField FROM MyTable WHERE FALSE;", _
dbOpenDynaset)

rs.AddNew
rs!MyRequiredField = "Some Default Value"
dwNewANValue = rs!MyAnField
rs.Update

This is in VB syntax because I cannot remember enough dBase language to
know what it looks like in VFP. You should probably get the idea though.

Hope it helps


Tim F
 
Back
Top