Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's wrong with this Query? 1

Status
Not open for further replies.

ecobb

Programmer
Dec 5, 2002
2,190
US
Hi, this is my first .asp project and I'm having problems passing a URL Variable (I guess you call it QueryString) to a query. I thought it would be simple enough, but I keep getting an error.

Here's the query:
Code:
SELECT * FROM tblname WHERE schoolid = Request.QueryString('schoolid') ;
And here's the error:
Code:
Microsoft JET Database Engine error '80040e14' 

Undefined function 'Request.QueryString' in expression.
What am I doing wrong? The url string is a numeric value, like this: whatever.asp?schoolid=17817

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
The querystring is part of ASP, not SQL (which is what the rest of your string is. Try this:
Code:
strSQL = "SELECT * FROM tblname WHERE schoolid = " & Request.QueryString('schoolid')
Also bear in mind that if your querystring value is null, this will fail. Does this make sense to you? Post back if you have further questions.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Ok, I see now. Thanks, that got it!

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
That should be Request.QueryString([red]"[/red]schoolid[red]"[/red])


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top