SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Threaded View

  1. #1
    SitePoint Zealot akohl's Avatar
    Join Date
    Jun 2001
    1 Post(s)
    0 Thread(s)

    [ODBC Microsoft Access Driver] Too few parameters. Expected 3.

    I am getting the following error message from my
    website on a page that works fine when I test it
    with iss on my own computer. Also, another subroutine
    (a login script), on the same asp page, using the
    same connection object and an identically set up
    recordset object works fine. So I don't see why it's
    not working here. Is it because of my use of
    aliases for field names in the sql query?

    I asked support at my webhosting company and they
    responded that there is an invalid field name
    either in the where or orderby clauses.

    But the entire query is cut and paste from the
    access databse that it connects to. And the query
    works fine on the identical db file on my own
    computer both from within access and through
    the adodb conncection.

    Can someone please explain the meaning of the error
    message? What parameters is server expecting?

     Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3.
    /akohl/pomeranz/default.asp, line 1595
    The line it refers to is:
    Code: sqlStr,con1,3,3
    Other relevant lines in the code are:
    set Con1 = Server.CreateObject("ADODB.Connection")
    con1.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\\premfs2\sites\Database\db1c.mdb")

    dim rsShowSales, sqlStr 
    set rsShowSales = server.CreateObject("ADODB.recordset")
    and here is the query
    sqlStr="SELECT shipments.shipment_id, shipments.date_entered, shipping_codes.code_name,"
    sqlStr=sqlStr&"[books].[title] & "" - "" & [issue_details].[binding] AS Book,"
    sqlStr=sqlStr&"issue_details.price, orders.quantity, [price]*[quantity] AS total,"
    sqlStr=sqlStr&"[users].[first_name] & "" "" & [users].[middle_name] & "" "" & [users].[last_name] AS Name,"
    sqlStr=sqlStr&"users.pob, users.street,, [users].[state] & "" "" & [users].[country] AS State,"
    sqlStr=sqlStr&", [users].[phone_area_code] & ""-"" & [users].[phone_standard] AS Phone,"
    sqlStr=sqlStr&"accounts.card_type, accounts.card_number, accounts.date_expires"
    sqlStr=sqlStr&" FROM books INNER JOIN ((((orders INNER JOIN shipments ON orders.shipment_id = shipments.shipment_id) INNER JOIN (shipping_codes INNER JOIN issue_details ON shipping_codes.[shipping-code_id] = issue_details.[shipping-code_id]) ON orders.issue_details_id = issue_details.issue_details_id) INNER JOIN accounts ON orders.account_id = accounts.account_id) INNER JOIN users ON accounts.user_id = users.user_id) ON books.book_id = issue_details.book_id"
    sqlStr=sqlStr&" WHERE (((shipments.date_entered)>=Now()-"&days&"))"
    sqlStr=sqlStr&" ORDER BY shipments.shipment_id, issue_details.price DESC;"
    Last edited by akohl; May 22, 2002 at 08:21.


Posting Permissions

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