konekcija.setHostName("my_hosting.com");
konekcija.setDatabaseName("my_base_name");
konekcija.setUserName("my_user_name");
konekcija.setPassword("my_pass_word");
konekcija.open();
query.exec("CREATE TABLE experimental_table (id INT NOT NULL, username VARCHAR(20) NOT NULL)");
konekcija.close();
}
When I compile this, it doesn't do anything! Not even to show an empty window!!!
But, when i Run this for second time, it displays a message:
query.exec() database not open
BTW, I have inserted
QT +=core
and also
QT +=sql
into my .pro file!!! So, that's not a problem!!!
I also tried something like:
QSqlQuery query;
with
query.exec("CREATE TABLE experimental_table (id INT NOT NULL, username VARCHAR(20) NOT NULL)", konekcija);
Whatever I do it's always the same!!!
What am I doing wrong? Tanx!!!