Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : Passing QueryString parameters to a select query Signup · Login
Author Thread
Passing QueryString parameters to a select query
Posted in tutorial: Running Stored Queries in Access Database
·  Kaitelan
User
Joined: 11 Apr 2006
Total Posts: 1
Passing QueryString parameters to a select query
Posted: 11 Apr 2006
I create/maintain the intranet pages for my office, more because I had an interest in it rather than being a programmer of any kind, which I'm not, though I am perpetually trying to learn.

Some of the links to documents on my site use the format "... .asp?action=name?cat=LNK21?catsub=211 where the cat= and catsub= changes for each link.

Using the normal table access method I capture the query string data into variables sCat and sCatSub and then place them into the SQL Select statement as "WHERE Category = '" & sCat & "' AND CatSub = '" & sCatSub & "'. This works okay.

I tried your code and I must be missing something obvious because the content of the variables is not being passed to the stored query.

I've tried both of these:

Set rs = con.Execute ("exec qryG8Links 'sCat', 'sCatSub'")
and
Set rs = con.Execute ("exec qryG8Links sCat, sCatSub")

But neither works. Should the variable names I used in the query itself be the same as the ones I am using in the asp code? I ask, because they are not. I used just 'cat' and 'catsub' in the SQL string.

The query itself does work. When i run it inside MS Access it asks for the parameters and when I type them in it displays the correct records.

I have a feeling whatever I'm doing wrong is very simple, but what is it? And what's the correct way to do it?

Any clues would be helpful. Thanks.

Kaitelan

Users Subscribed To This Thread
robertl  

Users Who Have Visited This Thread In Last 24 Hours
8 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.