Results 1 to 1 of 1

Thread: Error in connecting to MS ACCESS

  1. #1
    Join Date
    Jul 2008
    Location
    Philippines
    Posts
    60
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Error in connecting to MS ACCESS

    hi all...

    i'm current developing a simple application that will connect to MS Access database..

    My application connected successfully with the database using this code:

    Qt Code:
    1. QString db = "DRIVER={Microsoft Access Driver (*.mdb)};";
    2. db += "FIL={MS Access};DBQ=" + qApp->applicationDirPath ()" ;
    3. db+= "/myaccessdb.mdb;";
    4.  
    5. QSqlDatabase defaultDB = QSqlDatabase::addDatabase("QODBC3");
    6. defaultDB.setDatabaseName(db);
    To copy to clipboard, switch view to plain text mode 

    But when I started my query statement, this error occured..

    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. QODBC3: Unable to execute statement

    Here's my query:

    SQL Code:
    1. SELECT ITE_CODE, ITE_DESC, UNT_PRIC FROM sampletb WHERE ITE_CODE= "95506562"
    To copy to clipboard, switch view to plain text mode 


    How can I fix this error? pls help.. thanks...
    Last edited by jacek; 10th September 2008 at 11:39. Reason: fixed bbcode

Similar Threads

  1. Connecting to MS ACCESS
    By berzeck in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2007, 21:30
  2. connecting QT3 with MS Access database
    By raghvendramisra in forum Qt Programming
    Replies: 1
    Last Post: 2nd February 2007, 09:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.