1 | initial version |
In MS Access with an OleDb connection, the process for obtaining the primary key value when executing an Insert Into command is to use the @@Identity property. This property returns the last inserted autonumber value in the current session. To use it, you need to execute a SELECT statement immediately after the INSERT statement to retrieve the value. For example:
INSERT INTO TableName (Field1, Field2, Field3)
VALUES ('Value1', 'Value2', 'Value3');
SELECT @@Identity;