Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    Rhondda, Wales, UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy 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..

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That error in my experience means you either misspelled a field name, or are looking for a field that isn't in the database.

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New Coder
    Join Date
    Jul 2002
    Location
    Rhondda, Wales, UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've triple checked spelling on var names, the line was originally:

    lRequestID = CLng(RequestRegisterDB.Fields(0).Value)

    but tried the var name as a case of elimination, the field def exsists for the field returned is the 'Identity', which is the first field in the database. Nevermind, suppose i'll resort to brute force and search for me hammer

  • #4
    New Coder
    Join Date
    Jul 2002
    Location
    Rhondda, Wales, UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Found the problem,

    /* Fixes "Closed ADO RecordSet" problem when using temp table */
    SET NOCOUNT ON


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •