PDA

View Full Version : PLEASE HELP - ERROR


James
04-21-2000, 03:06 PM
What does This error mean:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error ' 80040e10' <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. <BR><BR>/asp/login/validate.asp, line 30 <BR><BR><BR>and HOW can i fix it please!<BR><BR>here is my code...<BR><BR><BR><%@ language="vbscript" %><BR><BR><% 'Option Explicit %><BR><BR><% Response.Expires = 0 %><BR><BR><% Dim url, strname, strpass %><BR><BR><%<BR>url = Request.form("url")<BR>strname = Request.form("name")<BR>strpass = Request.form("pass")<BR>%><BR><BR><%<BR>IF isempty(url) OR url = "" THEN<BR>url = "index.asp"<BR>END IF<BR><BR><BR>Dim SQL, x, conn<BR><BR>SQL="SELECT * FROM login WHERE name = " & strname & " AND pass = " & strpass<BR><BR>'SQL="SELECT carName FROM Cars ORDER BY carName"<BR>'SQL="SELECT * FROM login WHERE name = " & strname & " AND pass = " & strpass<BR><BR>set conn = server.createobject("ADODB.Connection") 'creates object to manipulate DB<BR>conn.open "login" 'name of dsn<BR>Set x=conn.execute(SQL) 'do stuff to DB<BR>%><BR>... etc etc<BR><BR>help please! (and let me know by email if you would be so kind)<BR>jamesshubin@sympatico.ca

Jim
05-08-2000, 12:49 PM
Try This..(single quotes around the Reuqested variable..)<BR><BR>SQL="SELECT * FROM login WHERE name = '"&strname&"' AND pass = '"&strpass&"'"<BR>

krishna
05-18-2000, 05:00 PM
This error occurs when the where condition is wrong. If Expected 1 then first where condition is wrong. If expected 2, second where condition is wrong. you have not given single quote(') in where condition. check it once.<BR>Have a nice day.<BR>Krishna

leo m
05-27-2000, 11:18 AM
my guess is when you said <BR><BR>sql ' do stuff to database<BR><BR>you were using Insert Into or something like that<BR><BR>you need to sets, (table field names) VALUES ('new value')<BR><BR>the syntax is:<BR><BR> (tblFieldname1, tblFieldname2, tblFieldname3) VALUES ('text1', 'text2', 'text3')<BR><BR>if you have the parts of the expression set as a variable, trying having it write out and see that it is in the right syntax. Your error is either from having not the right amount of fields on each side of the expression or from having a wayward , ' or " in there