Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Problem accessing QueryString [modified]

Problem accessing QueryString [modified]

Scheduled Pinned Locked Moved Web Development
helpdatabasesysadminquestiondiscussion
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sduffield
    wrote on last edited by
    #1

    Please help. Here is the record layout of my Access Database. ID VENDNO VENDOR BEL COL HAR JEF MOR SUPNO SUPPLY On my webpage I have an image of a five county area in Ohio with hotspots. (BEL, COL, HAR, JEF, MOR are those counties)When a visitor clicks on a county (the link looks like ?county=COL) then I want the code to show every vendor that does not have an "X" in the corresponding county. Here is the code I have so far: <% Set connectionToDatabase=Server.CreateObject("ADODB.Connection") connectionToDatabase.ConnectionTimeout=60 connectionToDatabase.Open "DSN=ICDC_Brands" Set recordSet=Server.CreateObject("ADODB.Recordset") recordSet.Open "SELECT * FROM vendor", connectionToDatabase if Request.QueryString("county") = "" then Response.Write("") elseif Request.QueryString("county") <> "" then Do While NOT recordSet.EOF I think this is problem line --> If recordSet("Request.QueryString") <> "X" Then Response.Write(recordSet("VENDOR") & "<br>") end if recordSet.MoveNext Loop end if connectionToDatabase.Close Set connectionToDatabase=Nothing %> When I visit the page and click on a county, the web browser says: ADODB.Recordset error '800a0cc1' Item cannot be found in the collection corresponding to the requested name or ordinal. /test/brands.asp, line 110 Any thoughts would be appreciated. Thank you

    modified on Wednesday, February 10, 2010 3:47 PM

    T N 2 Replies Last reply
    0
    • S sduffield

      Please help. Here is the record layout of my Access Database. ID VENDNO VENDOR BEL COL HAR JEF MOR SUPNO SUPPLY On my webpage I have an image of a five county area in Ohio with hotspots. (BEL, COL, HAR, JEF, MOR are those counties)When a visitor clicks on a county (the link looks like ?county=COL) then I want the code to show every vendor that does not have an "X" in the corresponding county. Here is the code I have so far: <% Set connectionToDatabase=Server.CreateObject("ADODB.Connection") connectionToDatabase.ConnectionTimeout=60 connectionToDatabase.Open "DSN=ICDC_Brands" Set recordSet=Server.CreateObject("ADODB.Recordset") recordSet.Open "SELECT * FROM vendor", connectionToDatabase if Request.QueryString("county") = "" then Response.Write("") elseif Request.QueryString("county") <> "" then Do While NOT recordSet.EOF I think this is problem line --> If recordSet("Request.QueryString") <> "X" Then Response.Write(recordSet("VENDOR") & "<br>") end if recordSet.MoveNext Loop end if connectionToDatabase.Close Set connectionToDatabase=Nothing %> When I visit the page and click on a county, the web browser says: ADODB.Recordset error '800a0cc1' Item cannot be found in the collection corresponding to the requested name or ordinal. /test/brands.asp, line 110 Any thoughts would be appreciated. Thank you

      modified on Wednesday, February 10, 2010 3:47 PM

      T Offline
      T Offline
      thatraja
      wrote on last edited by
      #2

      change that line

      If recordSet(Request.QueryString("county")) <> "X" Then

      thatraja

      S 1 Reply Last reply
      0
      • S sduffield

        Please help. Here is the record layout of my Access Database. ID VENDNO VENDOR BEL COL HAR JEF MOR SUPNO SUPPLY On my webpage I have an image of a five county area in Ohio with hotspots. (BEL, COL, HAR, JEF, MOR are those counties)When a visitor clicks on a county (the link looks like ?county=COL) then I want the code to show every vendor that does not have an "X" in the corresponding county. Here is the code I have so far: <% Set connectionToDatabase=Server.CreateObject("ADODB.Connection") connectionToDatabase.ConnectionTimeout=60 connectionToDatabase.Open "DSN=ICDC_Brands" Set recordSet=Server.CreateObject("ADODB.Recordset") recordSet.Open "SELECT * FROM vendor", connectionToDatabase if Request.QueryString("county") = "" then Response.Write("") elseif Request.QueryString("county") <> "" then Do While NOT recordSet.EOF I think this is problem line --> If recordSet("Request.QueryString") <> "X" Then Response.Write(recordSet("VENDOR") & "<br>") end if recordSet.MoveNext Loop end if connectionToDatabase.Close Set connectionToDatabase=Nothing %> When I visit the page and click on a county, the web browser says: ADODB.Recordset error '800a0cc1' Item cannot be found in the collection corresponding to the requested name or ordinal. /test/brands.asp, line 110 Any thoughts would be appreciated. Thank you

        modified on Wednesday, February 10, 2010 3:47 PM

        N Offline
        N Offline
        Nilesh Hapse
        wrote on last edited by
        #3

        I think the problem is with this line:

        Response.Write(recordSet("VENDOR") & "<br>")

        As I can see VENDOR is the table name from database. You can try using some column name from VENDOR table.

        "Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup

        T S 2 Replies Last reply
        0
        • N Nilesh Hapse

          I think the problem is with this line:

          Response.Write(recordSet("VENDOR") & "<br>")

          As I can see VENDOR is the table name from database. You can try using some column name from VENDOR table.

          "Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup

          T Offline
          T Offline
          thatraja
          wrote on last edited by
          #4

          sduffield wrote Please help. Here is the record layout of my Access Database. ID VENDNO VENDOR BEL COL HAR JEF MOR SUPNO SUPPLY actually he already mentioned the table structure so you can see the "VENDOR" column. thatraja

          N 1 Reply Last reply
          0
          • T thatraja

            sduffield wrote Please help. Here is the record layout of my Access Database. ID VENDNO VENDOR BEL COL HAR JEF MOR SUPNO SUPPLY actually he already mentioned the table structure so you can see the "VENDOR" column. thatraja

            N Offline
            N Offline
            Nilesh Hapse
            wrote on last edited by
            #5

            :-O :-O :doh: My bad. Missed that one.

            "Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup

            T 1 Reply Last reply
            0
            • N Nilesh Hapse

              :-O :-O :doh: My bad. Missed that one.

              "Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup

              T Offline
              T Offline
              thatraja
              wrote on last edited by
              #6

              No problem, Here before i did also somewhere like you. :-O thatraja

              modified on Thursday, February 11, 2010 5:10 AM

              1 Reply Last reply
              0
              • T thatraja

                change that line

                If recordSet(Request.QueryString("county")) <> "X" Then

                thatraja

                S Offline
                S Offline
                sduffield
                wrote on last edited by
                #7

                Thank you

                1 Reply Last reply
                0
                • N Nilesh Hapse

                  I think the problem is with this line:

                  Response.Write(recordSet("VENDOR") & "<br>")

                  As I can see VENDOR is the table name from database. You can try using some column name from VENDOR table.

                  "Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup

                  S Offline
                  S Offline
                  sduffield
                  wrote on last edited by
                  #8

                  Thank you for your thoughts

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups