Ok, your code works fine on my side. So next guess createtableqry points the the wrong database connection. Where do you initialize it? Use for testing aright bevor you use it.Qt Code:
To copy to clipboard, switch view to plain text mode
And it's no good idea to have a QSqlQuery as a member variable, can easily cause errors on exit the application like "Closing xxx while database xx still in use" or something like that.





Reply With Quote

Bookmarks