Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert-question

Status
Not open for further replies.

Stovio

Programmer
Mar 20, 2002
30
SE
Hi,
Using ASP, after inserting to a table with a counter as the primary key (ID), is there
some simple way to retrieve that ID without having to get a new recorset and
checking the highest ID nr? With some bad luck, somone could have inserted
to the table during the time it takes to get that recordset, making the
highest ID nr the wrong one.

DB: Access 2002

(Let me know if you need more info)
/H
 
Either access the ID just before the insert or if after the insert use the recordset and using other ID information that is unique retrieve the resulting ID that ACCESS has assigned the record. This would be the only two ways of doing this I believe and give you accurate ID information.

I guess you could do the recordset after option and look at the other data at that time if not equal perform a number of .moveprevious commands to move back to the one that matches your data insert.

Just a thought.

Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top