I have the following query in VBA:
DoCmd.RunSQL "INSERT INTO table (value) VALUES ('example')"
(with automatically incrementing primary key called id)
id
How can I get the auto-increment identifier generated by this insert?
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
Source: https://habr.com/ru/post/1737255/More articles:Access Denied error while trying to delete ClearCase.mkelem file - clearcaseВызов метода объекта С# из IronPython - c#Recommendations for developing a WPF application without using MVVM or similar - wpfDoes Java Spring 3.0 MVC support client-side support based on annotation / attribute like Asp.net MVC 2.0? - javaiPhone Frameworks - iphoneWhy is fishing the most useful shuffling algorithm? - algorithmDo I need to automatically log in after activating an account? - user-interfaceCreating a single WSDL file for several classes - javaGetting EXC_BAD_ACCESS without any useful messages from NSZombieEnabled - stack-traceUser Interface Code Level Templates? - user-interfaceAll Articles