Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help, reading form access

    <%

    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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •