...

View Full Version : Help, reading form access



solal
01-26-2003, 03:15 PM
<%

MySQL="SELECT noflim.nofelfn FROM noflim WHERE nofelfn="""&Request.Form("nofel")&""""

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("../db/noflim.mdb") & ";"

Set RS = oConn.Execute( MySQL )
While Not RS.EOF
Response.Write "here is your search results: " & ("nofelfn") & ("nofelln") & "<BR>"
RS.MoveNext
WEND

RS.close
Set RS = Nothing

oConn.close
Set oConn = Nothing

%>
The problm which is being written:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Line 8

whammy
01-26-2003, 03:54 PM
Your SQL Statement looks wrong... it should probably be:

MySQL="SELECT noflim.nofelfn FROM noflim WHERE nofelfn = '" & Request.Form("nofel") & "'"

P.S. Usually the best way to start debugging problems with a SQL Statement is to write it out like so:

MySQL="SELECT noflim.nofelfn FROM noflim WHERE nofelfn = '" & Request.Form("nofel") & "'"
Response.Write(MySQL) : Response.End

That will let you see exactly what's being generated. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum