Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2005, 10:40 AM
Friend of Wrox
 
Join Date: Oct 2005
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:

Code:
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)
objComm.Parameters.Append(objParam1)
objParam1.value = strSetCode

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

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

Many thanks in advance all!

Rich
__________________
Rit
www.designandonline.co.uk
INSPIRE | CREATE | DELIVER
 
Old October 26th, 2005, 04:00 PM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

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

Rich





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





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