How to get ID after inserting a row

  • Thread starter Thread starter tcmleung
  • Start date Start date
T

tcmleung

Guest
In Microsoft SQL Server, we can use "SELECT @@identity" to get the ID--identity after inserting a row.
Then how can we get the ID in Access Database after inserting a row?
 
Why would you want to insert a row? If you are adding data then you would add the data to the table and your query would sort the data to the way that you want to view it.

If you still need to insert a row, then so long as you have an autonumber field then you should be able to return the Max of the autonumber field after inserting the row, which will give you the ID
 

Users who are viewing this thread

Back
Top Bottom