Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Too few parameters"??

Status
Not open for further replies.

adamsoderqvist

Programmer
Sep 8, 2001
136
SE
I keep getting the same err msg when I connect to an access DB;

"Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1."

And the code is;

---begin code---

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DRIVER={Microsoft Access Driver
(*.mdb)}; " & "DBQ=" & Request.ServerVariables("APPL_PHYSICAL_PATH") & "ptrl\Members.mdb"
objConn.Open

'Declare recordset object...
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")

'Declare SQL query...
Dim strSQL
strSQL = "SELECT UserName, Password, LastLogin, UserLevel FROM tblMember WHERE UserName='" & strUserName & "'"

'Open the database and get the requested info!
objRS.Open strSQL, objConn

---end code---

What's wrong?? What bugs is that this code is the EXACT same as I've used in another project, and it worked perfectly.
I've also tried: "objConn.Execute strSQL", with the same result

Pls hlp!!
 
this error happens when you try to select from an Access
database using a column name that doesnt exist, check your select statement again. If you have not misspelled anything you may be using reserved words in the select statement, you cang et around this by renaming your columns in the dbase or putting brackets ([]) around the column names in the select statement.

good luck
Jeremy
 
I think the problem is with your field called UserName. I'd rename that one first.

Good luck!

Brenda:p
 
Password is a reserved word.

Could also be an error if your variable strUserName is empty.

add

response.write strSQL

before

objRS.Open strSQL, objConn

to see what is actually passed into your sql statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top