you can use the thread to get the last ID if you hit it with that statement after teh insert. you should be locking the database when inserting anyhow or the db will crash when you hit it at teh same time with multiple users.
first thing, searching the net for @@identity should give you hundreds of hits on performing this task with all databases but here's what I mentioned you can do previously seeing as 2K must not support the multi SQL Statement
obviously seperating the statements is the next thing to hit the DB with
you have some issues with the code above unless you're just pasting parts and not pasting the parts that are needed
the main downfallsa re
conn.open connection
<--bad idea to use restricted words, try connectionString
conn.execute(sql)
connectme="DSN=connection"
<--this is out of place and not referenced anywhere in your posted code as the connection to use
You need to use the same connection for these executes.
you should declare all your objects before coding anything dealing with the actions upon them also.
now to seperate the statements beign the next step as I can't debug your statements to see if tehre are syntax errors in them so I'll assume access doesn't support this (as it doesn't support much) unless someone ahs input to that.
so,
Dim sql,connectme
Dim identityRS
Dim cnn, identSQL
set cnn = Server.CreateObject("ADODB.Connection"

Set identityRS = Server.CreateObject("adodb.Recordset"
connectme="DSN=connection"
cnn.Open(connectme)
sql = "insert into
somewhere (
columns) values (
some values)
identSQL = "SELECT @@IDENTITY AS NewID"
cnn.Execute(sql)
identityRS.Open(identSQL)
response.write identityRS("NewID"
I know only 2K supports @@identity so that information would help in further helping you
_____________________________________________________________________
Hakuna matata!!