View Full Version : Request.Querystring error
Hi, im new to ASP, and Im trying to make a an ASP connection to a MDB. I have got that far, but now a new problem. When I put the insert command for a forum, I keep getting this error:
Microsoft JScript runtime error- Error '800a01c2'
Wrong number of arguments or invalid property assignment
/ASP/index.asp, line 8
Here is what I have on line 8-10.
if (Request.QueryString) {
MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
}
Here is the whole page code: http://pastebin.com/398009
Greatly helpful if you could help me. Im trying to make a page to create a username and pass mostly, and also name and email.
oracleguy
10-18-2005, 11:46 PM
The QueryString property is an array of variants and cannot be used like a boolean in that context.
Additionally, most people refer to the querystring by a specific one. e.g.:
myvar = Request.QueryString("myqueryvar")
I believe if you use it without an array index it will just return the entire querystring.
Sorry but as I said, im new to ASP, and this is the first time im doing this. So for this to work I have to defined a variable to this right? In this case then, what would I put in the declare variables then?
Also, I did this in dreamweaver 8, i used the server behaviour so it automaticly generated this for me. Maybe you could give me the actual code I could insert in there.
Sorry for being so ununderstanding but this is the actual first time I've worked with this, and well I'm still young, haven't done any courses but will in the future.
oracleguy
10-19-2005, 06:20 AM
Try doing:
if (Request.QueryString <> "") {
MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
}
See if that works.
glenngv
10-19-2005, 08:07 AM
Try doing:
if (Request.QueryString <> "") {
MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
}
See if that works.
You mixed VBScript and Javascript syntax. It should be:
if (Request.QueryString != "") {
//...
}
But in Javascript/JScript any non-null, non-empty, non-zero and non-undefined value plus of course the boolean true all evaluate to true. Non-boolean values are internally casted to its boolean equivalent when used in conditions. So it's perfectly valid to use:
if (Request.QueryString) {
//...
}
well, it still doesnt work. Maybe i need to get an older version of ASP? I still get the error even if i put what both of u said, and the original. Could it be that the AHTML has something wrong?
Error "Wrong number of arguments or invalid property assignment"
Maybe I have to assign a value or something?
But I still shouldnt get this. I mean dreamweaver shouldnt get this problem.
oracleguy
10-19-2005, 11:27 PM
You mixed VBScript and Javascript syntax. It should be:
if (Request.QueryString != "") {
//...
}
But in Javascript/JScript any non-null, non-empty, non-zero and non-undefined value plus of course the boolean true all evaluate to true. Non-boolean values are internally casted to its boolean equivalent when used in conditions. So it's perfectly valid to use:
if (Request.QueryString) {
//...
}
Duh! *bangs head on table* Lol, I wasn't even seeing that it was JScript and not VBScript, lol. I don't even know why I was doing that. Sorry for any confusion I caused DanB.
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.