
ADO 2.1/SQL Server 6.5 - IDENTITY Question
i'm developing a Cliente/Server App in VB 6 using ADO 2.1. Then database
back-end is a SQL Server 6.5 database.
This app is to be used by 15 or more simultaneous users. My problem concerns
on how can i do an insert into one table that as an Identity column and get
that value ??
i'm using SQL statments to do the insert using the Execute method of the
ADODB.Connection object. I need to insert one record in the master table,
and then
gather the Identity Column value so i can insert values in a details table.
I don't think that querying the database for the MAX value in that table
would work cos
in a multi user enviroment, i will be in risk that the value it returns will
be one inserted by
another user.
I'm doing this inside a transaction, so i must gather the value that isn't
yet in the database.
How can i do this????
Thanks for the time you spent reading this mail.
Thanks for your help!!