Just a bit of a syntax problem here. I'm using SQL and ASP and have this code thus far:
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Questions", conn
sql="INSERT INTO Questions(QuestionText, QuestionType)"
sql=sql & " VALUES "
sql=sql & "('" & qtext & "',"
sql=sql & "'" & "checkbox" & "');"
sql=sql & "DECLARE @testID int;"
sql=sql & "SET @testID = @@identity;"
on error resume next
conn.Execute sql,recaffected
if err<>0 then
Response.Write("An Error Has Occured")
else
end if
How would I pass the SQL variable @testID
to ASP so that it could be written within the response.write
Example:
Dim, ASPID
ASPID = @testID
Response.write(ASPID)
(obviously this is wrong) Could anyone tell me how to do this? Sorry if this is a bit too simple for some people :P