Item cannot be found in the collection corresponding to the requested name or ordinal.

Discussion in 'ASP General' started by Vinod, Feb 23, 2005.

  1. Vinod

    Vinod Guest

    "Dthmtl" <> wrote in message
    news:...
    > I know what this error is, all fieldnames have been verified and

    reverified.
    > Not sure why it is happening.
    >
    > Here is the SQL statement
    >
    > strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems

    LEFT
    > JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
    > Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"
    >
    > <td><% = rs("Problems.TicketNumber") %></td>
    >
    >
    >
    >


    Hi,

    enclose Problems.TicketNumber like this [Problems.TicketNumber] in the sql
    statement.
    Also try <%=rs(0)%>

    regards
    vinod
     
    Vinod, Feb 23, 2005
    #1
    1. Advertising

  2. Vinod

    Dthmtl Guest

    I know what this error is, all fieldnames have been verified and reverified.
    Not sure why it is happening.

    Here is the SQL statement

    strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems LEFT
    JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
    Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"

    <td><% = rs("Problems.TicketNumber") %></td>
     
    Dthmtl, Feb 23, 2005
    #2
    1. Advertising

  3. It'd just be called TicketNumber. Or better, use:

    <td><%=rs.Fields.Item(0).Value%></td>

    Ray at work

    "Dthmtl" <> wrote in message
    news:...
    > I know what this error is, all fieldnames have been verified and

    reverified.
    > Not sure why it is happening.
    >
    > Here is the SQL statement
    >
    > strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems

    LEFT
    > JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
    > Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"
    >
    > <td><% = rs("Problems.TicketNumber") %></td>
    >
    >
    >
    >
     
    Ray Costanzo [MVP], Feb 23, 2005
    #3
  4. Vinod

    Iain Norman Guest

    On Wed, 23 Feb 2005 15:20:44 -0500, "Dthmtl" <> wrote:

    >I know what this error is, all fieldnames have been verified and reverified.
    >Not sure why it is happening.
    >
    >Here is the SQL statement
    >
    >strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems LEFT
    >JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
    >Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"
    >
    ><td><% = rs("Problems.TicketNumber") %></td>
    >
    >
    >

    Response.Write the resulting strSQL to make sure there's nothing silly
    about it, usually that makes the mistake apparent in my experience.

    --
    Iain Norman | http://www.eliteforum.org
     
    Iain Norman, Feb 24, 2005
    #4
  5. Vinod

    Patrice Guest

    You forgot to check field names by dumping rs(i).Name for each field.

    Actually ADO uses the Table.Name notation only if there is a conflict. Else
    it uses just the field name i..e. TicketNumber...

    Patrice

    --

    "Dthmtl" <> a écrit dans le message de
    news:...
    > I know what this error is, all fieldnames have been verified and

    reverified.
    > Not sure why it is happening.
    >
    > Here is the SQL statement
    >
    > strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems

    LEFT
    > JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
    > Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"
    >
    > <td><% = rs("Problems.TicketNumber") %></td>
    >
    >
    >
    >
     
    Patrice, Feb 24, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    2,216
  2. Øyvind Isaksen
    Replies:
    1
    Views:
    1,031
    Øyvind Isaksen
    May 18, 2007
  3. J. Muenchbourg
    Replies:
    5
    Views:
    145
    Aaron Bertrand [MVP]
    Sep 27, 2003
  4. Augustus
    Replies:
    3
    Views:
    205
    Ken Fine
    Feb 5, 2004
  5. CJM
    Replies:
    2
    Views:
    227
Loading...

Share This Page