ODBiC Discussion Board


[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2

by jby2202, September 23, 2004 19:02

Hello,

When ever I try to run the search query, I keep getting this error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10' [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.

and it also keeps telling me that the error occurs at line 52. which goes like this:

rsGlobalWeb.Open SqlJunk, dbGlobalWeb,3,3

I've checked the program many times, and I have no idea what error the server is refering to.

My source code looks like this:

DSNName = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" DSNName = DSNName & Server.MapPath("db1.mdb")

Set dbGlobalWeb = Server.CreateObject("ADODB.Connection") dbGlobalWeb.Open DSNName

SqlJunk = "SELECT * FROM [X/X_database]"

If Request.Form("TypeSearch") = "M/Z" Then SqlJunk = SqlJunk & " WHERE M/Z LIKE '%" & _ Request.Form("DaInBox") & "%'" End If

If Request.Form("TypeSearch") = "AccessionNumber" Then SqlJunk = SqlJunk & " WHERE AccessionNumber LIKE '%" & _ Request.Form("DaInBox") & "%'" End If

Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset") rsGlobalWeb.Open SqlJunk, dbGlobalWeb ----> line 52



Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 


Copyright ©1997-2003, Roger Harris. All rights reserved.