Results 1 to 6 of 6

Thread: QSqlQuery crash in destructor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSqlQuery crash in destructor

    What about calling query.next() first before accessing the value? By the way, your "1" is ignored if you set the type of binding to "Out".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Dec 2008
    Posts
    29
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QSqlQuery crash in destructor

    Shame on me!! MSSQL via ODBC needs setForwardOnly(true) also for stored procedures..
    Qt Code:
    1. ...
    2. QSqlQuery query;
    3. query.setForwardOnly(true);
    4. query.prepare("{? = call dbo.proc03test(?);}");
    5. ...
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Sep 2009
    Posts
    36
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QSqlQuery crash in destructor

    +1 to waysotas post, see doc

Similar Threads

  1. QTemporaryFile and his destructor
    By SABROG in forum Qt Programming
    Replies: 3
    Last Post: 19th May 2009, 19:55
  2. QTableWidget Crash in Destructor
    By mclark in forum Qt Programming
    Replies: 19
    Last Post: 25th July 2008, 14:44
  3. Destructor in QT
    By hgedek in forum Newbie
    Replies: 1
    Last Post: 18th September 2007, 10:54
  4. Crash on QString Destructor
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2007, 14:28
  5. QList crash in destructor
    By mclark in forum Newbie
    Replies: 7
    Last Post: 6th December 2006, 15:27

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
  •  
Qt is a trademark of The Qt Company.