PDA

Click to See Complete Forum and Search --> : "Too few parameters. Expected 1." ***?!?


Jun 22nd, 2000, 06:26 PM
Can anyone see what's wrong with this?
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.

Ianpbaker
Jun 22nd, 2000, 06:48 PM
Hi matthewralston

Is yor username a string, because if it is you need to enclose the where Clause in '.


oRS.Open "SELECT * FROM users WHERE username='" & request("user") & "'", oConn

Hope this helps

Ian

Jun 22nd, 2000, 07:02 PM
Ah, yeah...cheers. I wondered if it might be that but I couldn't figure out what delimiters to use for a string...

' hey? takes me back to pascal :( used to usin them as comments now :)

Thanks.