I am familiar with the MySQL function LAST_INSERT_ID; is there a similar function for performing the same query with a MS Access database via ODBC?
In my specific case, I am using PHP+PDO to insert rows into an Access database, and would like to know the last primary key value of each insert as they are performed.
If this functionality is not available, are there any alternatives? (without changing the database)
Thank you.
It seems that Access 2000 or later supports the
@@IDENTITYproperty. So, you would only need to select its value after an INSERT:Please see the MSDN link:
Retrieving Identity or Autonumber ValuesIn short: