I need a function which executes an INSERT statement on a database and returns the Auto_Increment primary key. I have the following C# code but, while the INSERT statement w
Aren't most of the answerers forgetting that the asker is not using SQL Server?
Apparently, MS Access 2000 and later doesn't support @@IDENTITY. The alternative is "Using the RowUpdated event, you can determine if an INSERT has occurred, retrieve the latest @@IDENTITY value, and place that in the identity column of the local table in the DataSet."
And yes, this is for embedded VBA in the Access DB. That is still callable outside of Access via the Access Object Library.
Edit: ok, it is supported, sorry for the groggy early-morning answer. But the rest of this answer might help.