Nov 14, 2005 #1 angor Programmer Joined Sep 25, 2005 Messages 12 Location 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
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
Nov 14, 2005 #2 r937 Technical User Joined Jun 30, 2002 Messages 8,847 Location CA why is this in the microsoft access forum? use the mysql_insert_id() function r937.com | rudy.ca Upvote 0 Downvote
Nov 14, 2005 #3 LittleSmudge Programmer Joined Mar 18, 2002 Messages 2,848 Location GB 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. Upvote 0 Downvote
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.