I am trying to construct an insert record statement on an ASP page to insert data into Oracle. I need to bring back the unique ID which is created in the database as the data goes in. This is not working. I have attached the relevant code below. I've created the session variable and dragged it onto the new page, but I'm getting error on line 115 (red text). Could someone have alook at this and offer some suggestions. Maybe I need to start again.
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = "SET NOCOUNT ON;" & MM_editQuery & ";SELECT @" & "@IDENTITY AS Ident"
Set rsLastIdent = MM_editCmd.Execute
if NOT rsLastIdent.EOF then
strLastIdent = rsLastIdent.Fields.Item("Ident").Value
' place the new record ID in a session variable called "NewID"
Session("NewID") = strLastIdent