Windows ODBC Drivers for BigCommerce - getting new IDENTITY value?
Posted: Tue 29 Jan 2019 17:29
Hello!
Using your ODBC driver, is it possible to get the IDENTITY value of the most recently inserted row?
For example, when I INSERT a row to the Categories tables, how do I get the new "Id" value of the record I inserted?
I'm assuming a "hack" would be to pull the max value from the table as the IDENTITY columns are probably sequential/increasing values, but normally in VBA, I can use a command like this after doing the insert:
Instead of DAO, I could try using ADO in VBA, but wanted to ask before spending a lot of time trying numerous ways.
Other than that, the product is working great so far and had great value!
Thanks!
Using your ODBC driver, is it possible to get the IDENTITY value of the most recently inserted row?
For example, when I INSERT a row to the Categories tables, how do I get the new "Id" value of the record I inserted?
I'm assuming a "hack" would be to pull the max value from the table as the IDENTITY columns are probably sequential/increasing values, but normally in VBA, I can use a command like this after doing the insert:
Code: Select all
newID = db.OpenRecordset("SELECT @@IDENTITY").Fields(0)
Other than that, the product is working great so far and had great value!
Thanks!