I am using SCOPE_IDENTITY() to grab the recently inserted id value of one row to populate another, but it is not working, here is my code
rsIdentity(0) is coming out empty. The t_table1 has an auto identity yes and auto increment. Am I doing something wrong?
Thanks
Code:
SQLn = "insert into t_table1 (item1, item2, item3) values ('" & rs("item1") & "', '" & rs("item2") & "', '" & rs("item3") & "')"
objConn.execute SQLn
Set rsIdentity = objConn.Execute("SELECT SCOPE_IDENTITY() FROM t_table1")
response.write rsIdentity(0)
rsIdentity(0) is coming out empty. The t_table1 has an auto identity yes and auto increment. Am I doing something wrong?
Thanks