This is a discussion on "var = Request.QueryString(item) - why doesn't this work?!" within the Classic ASP section. This forum, and the thread "var = Request.QueryString(item) - why doesn't this work?! are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
var = Request.QueryString(item) - why doesn't this work?!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
var = Request.QueryString(item) - why doesn't this work?!
for the URL http://localserver/testmatrix.asp?project=AV9.12
This line: strProject = Request.QueryString(Project) yields this error: Request object, ASP 0102 (0x80004005) The function expects a string as input. /testmatrix.asp, line 9 This works, though: For Each item In Request.QueryString Response.Write(item & " = " & Request.QueryString(item) & VbCrLf) Next Can anyone tell me why I can't assign a QueryString parameter to a string var? Last edited by Donny Bahama; Jun 15th, 2006 at 22:04. |
|
|
|
#2
|
|||
|
|||
|
Re: var = Request.QueryString(item) - why doesn't this work?!
Post your code
|
|
#3
|
|||
|
|||
|
Re: var = Request.QueryString(item) - why doesn't this work?!
I may not be of much help here, but I thought it was supposed to be == not just = when setting a variable up to another one in ASP. I might be wrong though. (Sorry, C++ Programmer trying to learn ASP too).
|
|
#4
|
||||
|
||||
|
Re: var = Request.QueryString(item) - why doesn't this work?!
Quote:
Quote:
How to solve this problem: 1. Check where the value of Project is assigned. Make sure it isn't Null and you have not used the Set statement. If the value is assigned by a function, make sure that doesn't return an object. 2. It's best pratice.... Always do this:
************* Quote:
The Melonheads at Microsoft decided to only use "=", which depending on the statment can be a comparisson operator OR an assignment operator. I thought I'd mention it just to make sure there's no confusion.
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Last edited by spinal007; Jun 16th, 2006 at 07:58. |
|
#5
|
|||
|
|||
|
Re: var = Request.QueryString(item) - why doesn't this work?!
Thanks for the response, everyone! After I posted the initial question, I tried (just for the heck of it) this:
Quote:
Quote:
As I said, it's working now, so that's good, but it seems there's a learning opportunity here. |
|
#6
|
|||
|
|||
|
Re: var = Request.QueryString(item) - why doesn't this work?!
Quote:
|
|
#7
|
|||
|
|||
|
Re: var = Request.QueryString(item) - why doesn't this work?!
Well I have saved this to my learning folder. I'm sure this will help me in the future. Thanks for having this issue as it has helped me out too
|
|
#8
|
||||
|
||||
|
Re: var = Request.QueryString(item) - why doesn't this work?!
RMAOFL
It seemed from your first post that Project was a variable. ie:
I didn't know the parameter in the querystring you actually wanted was "project". Or I'd have simply said... Strings must be enclosed with "
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
![]() |
| Tags |
| var, doesnt, work |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing wildcards in a querystring | jayaime | Classic ASP | 0 | Oct 11th, 2006 19:02 |
| Getting an item from an array | monfu | ASP.NET Forum | 0 | Mar 29th, 2006 13:17 |
| request.querystring | breeze76 | Classic ASP | 5 | Oct 16th, 2005 14:35 |
| PLEASE HELP - Passing Variables in Querystring | just_the_basix | Classic ASP | 40 | Sep 3rd, 2004 10:46 |
| Selecting database records using the QueryString | courtjester | Classic ASP | 10 | Aug 27th, 2004 19:52 |