Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2005, 10:40 AM
Friend of Wrox
Join Date: Oct 2005
Location: , , United Kingdom.
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default Passing Multiple Parameters into Access Query

Hi All

I wonder if anyone can help. I have been using the Wrox ASP3 beginners book to create a search page looking up data within an Access 2000 database.

I have been trying to pass 2 parameters into a query but have had no success. I can pass one parameter with no problems. Can anyone show what I am doing wrong?

My code is:

strlname = request.Form("lname")
strSetCode = Request.Cookies("xyz")("Setcode")

Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = strConnect
objComm.CommandText = "qryUsearch"
objComm.CommandType = adCmdStoredProc

Set objParam1 = objComm.CreateParameter("Required SetCodeP", adVarChar, adParamInput, 50)
objParam1.value = strSetCode

Set objParam2 = objComm.CreateParameter("Required lnameP", adVarChar, adParamInput, 50)
objParam2 = strlname

Set objRS = objComm.Execute
...Its probably simple but I am on a learning curve.

Many thanks in advance all!

Reply With Quote
  #2 (permalink)  
Old October 26th, 2005, 04:00 PM
Friend of Wrox
Join Date: Oct 2005
Location: , , United Kingdom.
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post

Hi All

I found out what was causing the problem. It wasn't the code after all... What I was do is using the following wild card within my MS Access parameter:

Like "*" & [lnameP] & "*"

Now I can get the ASP to work without the wild card above but really to make a good free text search I need the wild card function

... does anyone know how to add a wild card type function to the Command.Parameter object?

Many thanks in advance

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameters to Access Report murtazasif Access VBA 2 November 6th, 2007 12:32 PM
Passing parameters to Access query pcassistnw Access 0 March 2nd, 2007 11:07 PM
Passing Multiple Parameters to a Crystal Report Pr miruthula Crystal Reports 0 February 2nd, 2007 06:04 AM
Entering Multiple Parameters in a Paramter Query jjc9809 Access 2 February 15th, 2006 09:36 PM
Access Forms Open Method of Passing Parameters androman Access VBA 8 September 22nd, 2004 09:04 AM

All times are GMT -4. The time now is 03:05 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.