logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 10-19-2007, 06:52 PM   #1
mastajbl
 
Join Date: Oct 2007
Posts: 2
Exclamation ERROR when doing multiple parameters

I get an too few parameters. expected 1. sometimes i receive a too few parameters expected 4. What i am trying to do is search 3 clumns of data in my database and display results per that search. i was able to get it to work with just one column search criteria, but when i try and add more WHERE it comes back errors. any ideas?

Code:
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include virtual="/JBLFINAL/Connections/Standards.asp" -->
<%
var rsStandards__varSearch = "*";
if (String((Request.Form("search"))) != "undefined" && 
    String((Request.Form("search"))) != "") { 
  rsStandards__varSearch = String((Request.Form("search")));
}
%>
<%
var rsStandards_cmd = Server.CreateObject ("ADODB.Command");
rsStandards_cmd.ActiveConnection = MM_Standards_STRING;
rsStandards_cmd.CommandText = "SELECT [APPLICATION], [GMNA STANDARDS], [JBL PART NUMBER], [DESCRIPTION], [PART CODE], REVISION FROM GMNA WHERE [JBL PART NUMBER] LIKE '*' + ? + '*' OR [GMNA] LIKE '*' + ? + '*' OR [PART CODE] LIKE '*' + ? + '*'
rsStandards_cmd.Prepared = true;
rsStandards_cmd.Parameters.Append(rsStandards_cmd.CreateParameter("param1", 200, 1, 255, rsStandards__varSearch)); // adVarChar
rsStandards_cmd.Parameters.Append(rsStandards_cmd.CreateParameter("param2", 200, 1, 255, rsStandards__varSearch)); // adVarChar
rsStandards_cmd.Parameters.Append(rsStandards_cmd.CreateParameter("param3", 200, 1, 255, rsStandards__varSearch)); // adVarChar
var rsStandards = rsStandards_cmd.Execute();
var rsStandards_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
rsStandards_numRows += Repeat1__numRows;
%>

Last edited by mastajbl; 10-19-2007 at 06:55 PM..
mastajbl is offline   Reply With Quote
Old 10-19-2007, 08:12 PM   #2
mastajbl
 
Join Date: Oct 2007
Posts: 2
Default

I get an error saying too few parameters expected 1. sometimes i receive a too few parameters expected 4. What i am trying to do is search 3 columns of data in my database and display results per that search. i was able to get it to work with just one column search criteria, but when i try and add more WHERE [JBL PART NUMBER] LIKE '*' + ? + '*' OR [GMNA] LIKE '*' + ? + '*' OR [PART CODE] LIKE '*' + ? + '*'
it comes back errors. any ideas?
mastajbl is offline   Reply With Quote
Old 10-19-2007, 11:10 PM   #3
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

there are no asp gurus on this forum

sorry
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:19 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com