Results 1 to 4 of 4

Thread: submitAll() : database error

  1. #1
    Join Date
    Jan 2007
    Posts
    38
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default submitAll() : database error

    I have a new problem , ie.

    this thread is in partial relation to the thread "update database" that i initially submitted.

    the full code i am using is attached.

    Whenever my program attempts to write to the database using submitAll() in the following piece of code:

    Qt Code:
    1. void submit()
    2. {
    3. model->database().transaction();
    4. if (model->submitAll()) {
    5. model->database().commit();
    6. } else {
    7. model->database().rollback();
    8. QMessageBox::warning(this, tr("Cached Table"),
    9. tr("The database reported an error: %1")
    10. .arg(model->lastError().text()));
    11. }
    To copy to clipboard, switch view to plain text mode 

    i get the following error:

    using unsupported buffer type: -842150451 (parameter: 2) QMYSQL3 : unable to bind value

    the QMYSQL3 bit is from the driver, using driverText(), everything before is from the database, using databaseText()

    i dont even know what the QMYSQL'3' is about, since i'm not using QT3 support classes. i am thinking the driver is QMYSQL.

    If anyone has ever dealt with this error before or have any ideas please let me know.

    thanks for your attention.
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: submitAll() : database error

    Hello,

    could you try get lastError() from QSqlDatabase.

  3. #3
    Join Date
    Jan 2007
    Posts
    38
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: submitAll() : database error

    thanks for the response

    i did use that though, that is where i got the errors from.

    what i am looking for is a way to get rid of it and write to my database.

    thanks again

  4. #4
    Join Date
    Jan 2007
    Posts
    38
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: submitAll() : database error(RESOLVED)

    Well ladies and gentleman, this is for all those who may come across this error in the future.

    Just a recap:

    eorror:
    Database:
    Using unsupported buffer type: -842150451 (parameter: 2)

    Driver:
    QMYSQL3: Unable to bind value
    note the 3 in the driver name, yeeeessss , QMYSQL'3'.

    The thing is the SQL Module in QT uses driver plugins in order to communicate with different database
    APIs.

    QT comes with some of those drivers already installed (QT4 came with QMYSQL3), and i was using MySQL 5.0, so basically I had a newer version
    of MySQL server than the one that the driver plugin
    was built with.

    Solution:
    Rebuild the plugin with the newer version MySQL library and include files in the path

    How:

    follow the qt instructions to build the mysql driver plugin using you mysql installation include files

    cd %QTDIR%\plugins\src\sqldrivers\mysql
    qmake -o Makefile "INCLUDEPATH+=C:\MYSQL\INCLUDE" "LIBS+=C:\MYSQL\LIB\OPT\LIBMYSQL.LIB" mysql.pro
    nmake

    If you get an error about could not open qsqlmysqld.dll, just add its directory/path to visual studio under Tools > Options > Projects > VC++ Directories > Executable Files

    For linux folks, and for everyone actually

    the instructions are found at:
    http://doc.trolltech.com/3.3/sql-driver.html

    well, chow for now.

Similar Threads

  1. Installation on Fedora Core 4
    By jcr in forum Installation and Deployment
    Replies: 3
    Last Post: 29th January 2009, 02:34
  2. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 05:19
  3. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 25th August 2006, 00:31
  4. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 13:52
  5. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 13:54

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.