This is a discussion on "Help with querystrings" within the Classic ASP section. This forum, and the thread "Help with querystrings are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Help with querystrings
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Help with querystrings
Hi i am new to ASP and trying to pull a querystring through another asp page i have done it on one of my other pages but this one will not. I have attached the code to this post. When i reqeust the querystring i am getting the correct value.
Any help would be appreciated. thanks. <% sql = "SELECT * FROM tblNews WHERE ID = " & Request.Querystring("ID") data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("news.mdb") ' Creating Connection Object and opening the database Set con = Server.CreateObject("ADODB.Connection") con.Open data_source set rs=server.createobject("ADODB.recordset") rs.open sql, con Response.Write(sql) Response.write(rs("article_title")) 'Done. Close the connection con.Close Set con = Nothing %> |
|
|
|
||||
|
Re: Help with querystrings
The code is pretty straight forward and seems fine.
Possible ways to debug your code: 1. Make sure the request is correct. Are your submiting actually the variable 'ID'? URL should look via like this: page.asp?ID=whatever 2. Is the request being redirected? 3. Is the script being called in response to a 404 error? Servers usually add the 404 error url to the query string. This causes variables submitted to the original script to not be accessible via request.querystring
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
![]() |
| Tags |
| help, querystrings |
| Thread Tools | |
|
|