With ASP I used to retrieve autonumbers of my primary field in the
following way:
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open DEF_connection
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.Open tablename, Connection, adOpenKeySet, adLockOptimistic, adCmdTable
RS.AddNew
insertedID = RS("ID") ' get ID *before* the update call
'insert in table 1
RS.Close
set rs = nothing
'insert in table 2
sql = "insert into tbl2 (IDfield,field1,field2) Values
(insertedID,value1,value2)"
connection.execute(sql)
Now with ASP.NET and DataSet, I'm not so sure how to retrieve the
autonumber value of my Access (parent) tables and insert this in one or
more child tables.
Can anyone help me with this one?