Item cannot be found in the collection corresponding to the requested name or ordinal
Hi there,
Has any 1 had problems with the error message below while inserting an SQL record?
-----------------------------------------
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
-----------------------------------------------
The error points to the following line:
-----------------------------------------------
Set RequestRegisterDB = Server.CreateObject("ADODB.Recordset")
sSourceString = "EXEC RegisterRequest " & txtLevel & ",'" & txtFullName & "','" & txtEmail & "','" & txtPhone & "','" & txtFax & "','" & txtComp & "','" & txtPos & "','" & txtCompAddr & "','" & txtSoftLevel & "'"
RequestRegisterDB.Open sSourceString, Application("ConnectionStringAdmin")
lRequestID = CLng(RequestRegisterDB.Fields("RequestID").Value)
RequestRegisterDB.Close
Set RequestRegisterDB = Nothing
--------------------------------------------
When inserting a record, if a submitted email matches an existing email address, RequestID = -1, else the identity number is returned.
The record is correctly inserted evan thow the error message is shown, and if the page is refreshed, the return value of -1 is correctly pickep up and processed, seems like the first attempt returns nothing.
I Response.Write'd sSourceString, copied the wrote text and executed in the 'Query Analyser' and it worked fine - returning a correct 'RequestID'.
Happened to any 1 else before? If so, please say how to resolve..
|