Results 1 to 4 of 4

Thread: QSqlQuery: Getting an Auto Increment value

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Location
    Brisbane
    Posts
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlQuery: Getting an Auto Increment value

    You're right, odbc doesn't support retrieval of this value, but a bit of googling turned up that apparently access supports "select @@identity", which apparently gives the information you want.

    Hope this helps.

  2. The following user says thank you to tangential for this useful post:

    Al_ (23rd December 2009)

  3. #2
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Smile Re: QSqlQuery: Getting an Auto Increment value

    YES! Works perfectly, many thanks. I feel a bit ashamed that I did not find this statement myself; but just little, judged by the many threads to this topic without solution, @@identity seems to be little known.

  4. #3
    Join Date
    Dec 2009
    Location
    Brisbane
    Posts
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlQuery: Getting an Auto Increment value

    Yeah, I found it about 3 levels deep when I was looking to see if there was a way to retrieve the information via ODBC (so I could fix the qt driver). Glad to have been able to help

Similar Threads

  1. Replies: 1
    Last Post: 20th May 2009, 20:36
  2. Replies: 4
    Last Post: 9th May 2008, 17:02
  3. Problems with QSqlQuery update
    By whoops.slo in forum Qt Programming
    Replies: 4
    Last Post: 28th August 2006, 07:17

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.