Hi
I am not sure why this does not work here, the same code is used on another page on the same site, but with another insert statement.
The record gets added but when I do the @@Identity it will not show the number, any ideas ?
sqlstr = "INSERT INTO tblTaskToolSandbox ([ProjectID], [PriorityID], [StatusID], [ShortDescription], [Comments], [Budget], [Requested_Date], [Estimated_Date],[Requestor],[EngDeadAgree]) VALUES (20,2,1,'" & replace(vartxtShortDesc,"'","''") & "', '" & replace(vartxtComments,"'","''") & "' ,0, " & amdate(now()) & "," & amdate(now()) & "," & Session("UserID") & ",0) "
Conn.execute(sqlstr)
sql = "SELECT @@IDENTITY AS varNum"
rs.Open sql , DSNTA, 2
response.write "-" & rs.fields("varNum") & "-"
response.end
I am not sure why this does not work here, the same code is used on another page on the same site, but with another insert statement.
The record gets added but when I do the @@Identity it will not show the number, any ideas ?
sqlstr = "INSERT INTO tblTaskToolSandbox ([ProjectID], [PriorityID], [StatusID], [ShortDescription], [Comments], [Budget], [Requested_Date], [Estimated_Date],[Requestor],[EngDeadAgree]) VALUES (20,2,1,'" & replace(vartxtShortDesc,"'","''") & "', '" & replace(vartxtComments,"'","''") & "' ,0, " & amdate(now()) & "," & amdate(now()) & "," & Session("UserID") & ",0) "
Conn.execute(sqlstr)
sql = "SELECT @@IDENTITY AS varNum"
rs.Open sql , DSNTA, 2
response.write "-" & rs.fields("varNum") & "-"
response.end