FE : Microsoft Access
BE : Sql Server
I use CurrentDb.OpenRecordset("select @@identity")(0) in AfterUpdate of a form to get the latest saved PK, without being sure how it works.
I've always been uncertain what will happen in a multi user environment.
If a user saves a new record to a table, and just after the save and before running above @@identity, another user saves another new record into the same table, does @@identity returns correct PKs for both users?
Since it is CurrentDB, and only one user is using the CurrentDB, is it safe to consider that the returned PK is correct?
I'm not sure if @@identity")(0) pulls the result from BE or CurrentDB.
I was thinking if the result is pulled out of the BE, the returned PK maybe different, because the last PK is what the other user has saved.
I hope I make sense here. I just want to be sure I don't mess anything up.
Thanks for any kind of advice.
BE : Sql Server
I use CurrentDb.OpenRecordset("select @@identity")(0) in AfterUpdate of a form to get the latest saved PK, without being sure how it works.
I've always been uncertain what will happen in a multi user environment.
If a user saves a new record to a table, and just after the save and before running above @@identity, another user saves another new record into the same table, does @@identity returns correct PKs for both users?
Since it is CurrentDB, and only one user is using the CurrentDB, is it safe to consider that the returned PK is correct?
I'm not sure if @@identity")(0) pulls the result from BE or CurrentDB.
I was thinking if the result is pulled out of the BE, the returned PK maybe different, because the last PK is what the other user has saved.
I hope I make sense here. I just want to be sure I don't mess anything up.
Thanks for any kind of advice.
Last edited: