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

last inserted ID number (mysql)

Status
Not open for further replies.

angor

Programmer
Sep 25, 2005
12
UA
could you please help me to get the ID of the last inserted row in the table?..
e.g.

INSERT INTO table1 (ID,name,surname) values ('null','My_name','My_surname')


where ID is AUTO_INCREMENT field.
Thank you.
Andrew
 
I use

dim rst as new ado.recordset
etc.
rst.ActiveConnection = {connection to MySQL}

rst.Open "SELECT Last_Insert_Id() As NewId"
lngNewId = rst!NewId

rst.close
etc..


'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top