Why isn't the column name specified in code found on the table?

Discussion in 'ASP General' started by Big Moxy, Nov 25, 2007.

  1. Big Moxy

    Big Moxy Guest

    Problem URL - http://projects.zanalysts.com/ariviewer/display.asp?ID=11

    I'm using Access as the "database".

    I get this error in the above URL:

    ADODB.Fields error '800a0cc1'
    Item cannot be found in the collection corresponding to the requested
    name or ordinal.
    /ariviewer/display.asp, line 498

    I know it's telling me that it cannot find the column name on the
    table.

    Here is line 498:

    If tables(tableID) <> "Husqvarna Equpment" Then
    Response.Write("<td>" & Recordset1.Fields.Item("Day").Value & "</
    td>")
    Response.Write("<td>" & Recordset1.Fields.Item("Week").Value & "</
    td>")
    Response.Write("<td>" & Recordset1.Fields.Item("Month").Value &
    "</td>")
    Else
    Response.Write("<td>" & Recordset1.Fields.Item("Price").Value &
    "</td>")
    End If

    However if you go to this URL - http://projects.zanalysts.com/ariviewer/test.asp
    - it displays the table name followed by the column names for this
    table delimited by "-".

    -Husqvarna Equipment-
    -Equipment Description-
    -ID-
    -Price-

    Unless my eyes are totally deceiving me, there is a column called
    "Price" in the Husqvarna table. The code below is used to display the
    column names.

    For Each objTable in objADOXDatabase.Tables
    If objTable.Type = "TABLE" then
    tables(i) = objTable.Name
    If tables(i) = "Husqvarna Equipment" Then
    Response.Write("-" & tables(i) & "-" & "<br>")
    For Each objColumn in objTable.Columns
    Response.Write("-" & objColumn.Name & "-" & "<br>")
    Next
    End If
    i = i + 1
    End If
    Next

    Can someone please help me identify what I am missing?

    Thank you!
     
    Big Moxy, Nov 25, 2007
    #1
    1. Advertising

  2. Big Moxy

    Big Moxy Guest

    On Nov 25, 2:53 pm, Big Moxy <> wrote:
    > Problem URL -http://projects.zanalysts.com/ariviewer/display.asp?ID=11
    >
    > I'm using Access as the "database".
    >
    > I get this error in the above URL:
    >
    > ADODB.Fields error '800a0cc1'
    > Item cannot be found in the collection corresponding to the requested
    > name or ordinal.
    > /ariviewer/display.asp, line 498
    >
    > I know it's telling me that it cannot find the column name on the
    > table.
    >
    > Here is line 498:
    >
    > If tables(tableID) <> "Husqvarna Equpment" Then
    > Response.Write("<td>" & Recordset1.Fields.Item("Day").Value & "</
    > td>")
    > Response.Write("<td>" & Recordset1.Fields.Item("Week").Value & "</
    > td>")
    > Response.Write("<td>" & Recordset1.Fields.Item("Month").Value &
    > "</td>")
    > Else
    > Response.Write("<td>" & Recordset1.Fields.Item("Price").Value &
    > "</td>")
    > End If
    >
    > However if you go to this URL -http://projects.zanalysts.com/ariviewer/test.asp
    > - it displays the table name followed by the column names for this
    > table delimited by "-".
    >
    > -Husqvarna Equipment-
    > -Equipment Description-
    > -ID-
    > -Price-
    >
    > Unless my eyes are totally deceiving me, there is a column called
    > "Price" in the Husqvarna table. The code below is used to display the
    > column names.
    >
    > For Each objTable in objADOXDatabase.Tables
    > If objTable.Type = "TABLE" then
    > tables(i) = objTable.Name
    > If tables(i) = "Husqvarna Equipment" Then
    > Response.Write("-" & tables(i) & "-" & "<br>")
    > For Each objColumn in objTable.Columns
    > Response.Write("-" & objColumn.Name & "-" & "<br>")
    > Next
    > End If
    > i = i + 1
    > End If
    > Next
    >
    > Can someone please help me identify what I am missing?
    >
    > Thank you!


    Duh! I misspelled the table name in my code.
     
    Big Moxy, Nov 26, 2007
    #2
    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. savvy
    Replies:
    1
    Views:
    494
    savvy
    Jan 18, 2006
  2. HeatherB
    Replies:
    0
    Views:
    7,863
    HeatherB
    Jul 25, 2005
  3. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    978
    Mark Rae
    Dec 21, 2006
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,220
    Smokey Grindel
    Dec 2, 2006
  5. lutorm
    Replies:
    14
    Views:
    522
    Maxim Yegorushkin
    Jul 29, 2005
Loading...

Share This Page