Hi all I have been trying for hours now to get a MySQL database to work in my project. Only problem is I am unable to create the database. I don't get any errors anything, nothing seems to happen. Everything compiles fine but no databases are created. Qt tells me that I have all the database drivers i need...
I have: ("QSQLITE", "QMYSQL3", "QMYSQL", "QODBC3", "QODBC")
The code that I'm using to try and create my database is:
db.addDatabase("QMYSQL");
db.setDatabaseName("test");
if(!db.open()){
message.information(this, "Error", "Database not opened");
}
QSqlDatabase db;
db.addDatabase("QMYSQL");
db.setDatabaseName("test");
if(!db.open()){
message.information(this, "Error", "Database not opened");
}
To copy to clipboard, switch view to plain text mode
What am I doing wrong? This is all beginning to annoy me now!!
Thanks for your time and trouble. Any help would be much appreciated
Bookmarks