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;
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-09-29 11:00:00 +0000
Seen: 15 times
Last updated: Mar 23 '23
What is the process of obtaining a column name by using a given row and its corresponding value?
What is the hook in VueJS for socket.on?
How can I install OmniSharp for Visual Studio Code without an internet connection?
What is causing my script to halt while scraping images from the web?
Why is the WebSocket not able to establish a connection with the server?
When I run expo start --dev-client, my application is unable to establish a connection.
What triggers the sending of a TCP/IP reset (RST) flag?
How can rows be sorted depending on the connection between the values in the cells?
Can a socket connection be maintained while changing routes in Angular?