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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO - How to get the ID of the record just added?

Status
Not open for further replies.

cascot

Programmer
Jan 30, 2002
127
CA
If I have a set of Parent/Child type tables like "Order" and "OrderItem", after creating a new record in the Order table, what is the best way of retrieving the OrderID of the record just added so that I can then add the related records to the "OrderItem" table (each of which needs the OrderID of the Order they are linked to)?
 
Apologies to all. I did a search of the forum using key words to ensure nothing had previously been posted asking this same question. Unfortunately I relied on the search and didn't bother to even glance at the last week or so of threads. I just did and there I discover that kingosticks asked the same question less than a week ago.

Next time I will be sure to go through several pages of recent threads as well as carrying out a keyword search before posting.

Once again my apologies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top