Results 1 to 12 of 12

Thread: QSQLITE logic error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2008
    Posts
    58
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QSQLITE logic error

    Thanks for the tip, this is the error message I get
    insert into clients (`cid`, `firstName`, `lastName`, `address`, `zipCode`, `city`, `phoneNr`, `email`) values ( '', :firstName, :lastName, :address, :zipCode, :city, honeNr, :email)
    So the prepare and the bindValue isn't working properly, is there anybody familiar with this problem?

    I've found something I'm passing QString vars in the bindValue, I've changed it to QVariant but that works neither.

    Could it be that it won't work because I'm converting a QString to QVariant;

    Here's the code to get the text
    Qt Code:
    1. QString strFirstName = firstNameLine->text();
    2. QString strLastName = lastNameLine->text();
    3. QString strAddress = addressLine->text();
    4. QString strZipCode = zipCodeLine->text();
    5. QString strCity = cityLine->text();
    6. QString strPhoneNr = phoneNrLine->text();
    7. QString strEmail = emailLine->text();
    8.  
    9.  
    10. if(database->addClient(strFirstName, strLastName, strAddress, strZipCode, strCity, strPhoneNr, strEmail)){
    11. clientDialog->accept();
    12. }else{
    13. QMessageBox::critical(clientDialog, "Error", "Er is een fout opgetreden bij het invoeren van een klant, neem contact op met de ontwikkelaar!");
    14. }
    To copy to clipboard, switch view to plain text mode 

    and here's the code of the function
    Qt Code:
    1. bool db::addClient(QVariant strFirstName, QVariant strLastName, QVariant strAddress, QVariant strZipCode, QVariant strCity, QVariant strPhoneNr = "", QVariant strEmail = ""){
    To copy to clipboard, switch view to plain text mode 
    Last edited by cyberboy; 8th February 2008 at 16:56. Reason: add information

Similar Threads

  1. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  2. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  3. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  4. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 24th August 2006, 23:31
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

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.