Results 1 to 7 of 7

Thread: Access mdb file - cant get list of tables or views with db.tables() list

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,332
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: Access mdb file - cant get list of tables or views with db.tables() list

    Your problem is that on line 32, you declare another instance of your variable "db", which hides the one you declare as a member variable of your class. As soon as conOpen() ends, this instance of "db" goes out of scope and is destroyed. Your member variable "db" is never initialized to anything.

    To fix it, simply remove the word "QSqlDatabase" from line 32.

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

    GoranSimunic (6th March 2016)

Similar Threads

  1. list tables column name (database)
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 26th September 2012, 11:18
  2. List of Views for a model
    By gkarthick5 in forum Newbie
    Replies: 3
    Last Post: 23rd June 2011, 08:06
  3. Replies: 4
    Last Post: 13th July 2010, 05:17
  4. Replies: 1
    Last Post: 16th May 2010, 19:25

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.