Nov 14, 2005 #1 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
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 Jun 30, 2002 8,847 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 Mar 18, 2002 2,848 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.