Results 1 to 2 of 2

Thread: How to compare SqlError type?

  1. #1
    Join Date
    Mar 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation How to compare SqlError type?

    Hi,

    Im connecting to my mysql database and i want know if the error type of db.lastError is equals to SqlError::ErrorType::NoError, but everything that i tried i got error.

    Can anyone help me?

    Something like this:

    Qt Code:
    1. if (db.lastError().type() == QSqlError::ErrorType::NoError)
    2. {
    3. ....
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: How to compare SqlError type?

    What is wrong with this
    Qt Code:
    1. if(db.lastError().type() == QSqlError::NoError)
    2. {
    3. ;
    4. }
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Compare 2 images in QT?
    By harshita in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2011, 06:32
  2. How do compare the two icons
    By addu in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2009, 16:19
  3. SQLError -1?
    By Januz in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2009, 01:35
  4. do we can't compare QIcon or QPixmap????
    By sudheer in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2008, 14:53
  5. Compare
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 14th March 2007, 15:03

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.