How to get a car number after INSERT in Ms Access?

I have the following query in VBA:

DoCmd.RunSQL "INSERT INTO table (value) VALUES ('example')"

(with automatically incrementing primary key called id)

How can I get the auto-increment identifier generated by this insert?

+3
source share
1 answer

I believe what you are looking for:

@@Identity

It is similar to SCOPE_IDENTITY in T-SQL. Check out this article for more information:

http://www.mikesdotnetting.com/Article/54/Getting-the-identity-of-the-most-recently-added-record

+7
source

Source: https://habr.com/ru/post/1737255/


All Articles