Hi
I got a MS Access DB which I use, I would like to get the AutoID after my Insert command
I would like to use "SELECT @@IDENTITY", but cannot get it to work, I hope there is somebody who can help.
I know I can use a new select and then find my record but I would like to use the Identiy which is more elegang to use )
Cheers
This is how I conntect to my DB:
'Set Conn = Server.CreateObject("ADODB.Connection")
DSNTA = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNTA = DSNTA & "DBQ=" & Server.MapPath ("/_private/DB/Database.mdb")
Here is my Insert String:
SQLRsAddUser = "INSERT INTO tblTriSecActis (UserName, Password, FullName, Handle, Email, TriActis) VALUES ('" & varUserName & "', '" & varPassword & "', '" & varFullName & "', '" & varHandle & "', '" & varEMail & "', " & cbool(varTriActis) & ")"
conn.execute(SQLRsAddUser)
I got a MS Access DB which I use, I would like to get the AutoID after my Insert command
I would like to use "SELECT @@IDENTITY", but cannot get it to work, I hope there is somebody who can help.
I know I can use a new select and then find my record but I would like to use the Identiy which is more elegang to use )
Cheers
This is how I conntect to my DB:
'Set Conn = Server.CreateObject("ADODB.Connection")
DSNTA = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNTA = DSNTA & "DBQ=" & Server.MapPath ("/_private/DB/Database.mdb")
Here is my Insert String:
SQLRsAddUser = "INSERT INTO tblTriSecActis (UserName, Password, FullName, Handle, Email, TriActis) VALUES ('" & varUserName & "', '" & varPassword & "', '" & varFullName & "', '" & varHandle & "', '" & varEMail & "', " & cbool(varTriActis) & ")"
conn.execute(SQLRsAddUser)