Godaddy SQL server connection problem
-
wrote on 16 Dec 2013, 21:00 last edited by
I was playing around with the tutorial for blackberry and wanted to see if I could connect to my web server database.
bool App::createDatabase()
{// 3. Open a connection to the database, if the database does not exist // one will be created if permitted. QSqlDatabase database = QSqlDatabase::addDatabase("QODBC"); bool success = false; // 2. Set the path of where the database will be located. // Note: The db extension is not required database.setHostName("ABC.db.800.hostedresource.com"); database.setDatabaseName("ABC database.setUserName("ABC") database.setPassword("123456!"); // 3. Open a connection to the database, if the database does not exist // one will be created if permitted. if (database.open()) { alert(tr("Database created/registered.")); success = true; } else { // If the database fails to open, error information can be accessed via // the lastError function. const QSqlError error = database.lastError(); alert(tr("Error opening connection to the database: %1").arg(error.text())); } // 4. Close the connection to the database. // Be warned, closing the database will invalidate any SqlQuery objects (see below) database.close(); return success;
}
I keep getting a error driver not loaded, I think maybe Godday server doesn't have a supported driver. Any suggestions
-
Hi and welcome to devnet,
Are you sure that you have the all dependencies required ?
1/2