I want to be able to insert a new record into the database, then retrieve the ID of that record, which is an identity field. My problem is that when I attempt to retrieve the ID, nothing comes back.
Here is a sample of my code:
DBConnect 1,"*","tblDocuments","DocumentID=0",1
oRS(1).AddNew
oRS(1)("DocumentName")=ContractName
oRS(1)("DocumentDate")=ContractDate
oRS(1)("ProjectID")=ProjectID
oRS(1)("DocumentTypeID")=2
oRS(1).Update
ContractID=oRS(1)("DocumentID")
ContractFileName="ContractID"&ContractID&"."&FileE xtension
Hence, the ContractFileName comes back as ContractID.doc...or whatever the extension is. The ID is not returned for some reason.