-
Can anyone see what's wrong with this?
Code:
dim oConn, oRS
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};"
oConn.ConnectionString = oConn.ConnectionString & "DBQ=" & Server.MapPath("../datastore.mdb") & ";" oConn.ConnectionString = oConn.ConnectionString & "PWD=" & sDBPassword
oConn.Open
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open "SELECT * FROM users WHERE username=" & request("user"), oConn
I keep getting a "Too few parameters. Expected 1." error on the last line when I try to open the recordset.
-
I think it just has to do with your syntax.
I guess that username must be a text field.
So the data it is set equal to must be surrrounded in
quotations.
Like this:
oRS.Open "SELECT * FROM users WHERE username = '" & request("user") & "'", oConn
Hope this helps.
-
The too few parameters error is telling you that you have a field name or table name that is not in the database. Check to make sure you are using the correct names.
Hope this helps
-
Cheers!
Yeah...I hadn't put single quotes (') around the string in the sql statement... I had tried using double quotes and the sql engine thingy had rejected it... I didn't think about using single quotes. I tend to think of them as comment delimiters now...takes me back to my Pascal days.