Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GETTING @@IDNETITY FROM SQL THRU ACCESS

Status
Not open for further replies.

LonnieJohnson

Programmer
Apr 16, 2001
2,628
0
0
US
HOW DO I RETRIEVE THIS VALUE BACK FROM SQL SERVER INTO AN ACCESS VARIABLE? I AM INSERTING NEW RECORDS INTO SQL FROM ACCESS AND I WOULD LIKE TO USE THE RECORDID (@@IDENTITY) FROM SQL.


prodevmg@yahoo.com
ProDev, MS Access Applications B-)

May God bless you in the year 2002.
 
I guess your table have PK it is autonumber.
And you used Dao to insert new record, SQL server not like Access, you must change to ADO.
It¡¯ll work fine.
This one happened to me. If my table has a autonumber, the vb code must be changed from Dao to ADO.

I hope it can help you. Good luck!

AnnYH
 
Thanks. I found that out this morning. You are exactly correct. You must run your SQL INSERT query thru ADO on the SQL platform, then send a SELECT for the IDENTITY. A97 cannot do this via DAO, only ADO.

Thanks for the confirmation. prodevmg@yahoo.com
ProDev, MS Access Applications B-)

May God bless you in the year 2002.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top