I’m developing a cross platform (windows + OSX) application that will be used commercially. The application will need to be able to access a database (MS SQL) and show the data.
I have installed the ActualODBC trial and use the following code to connect to the server:
QString connectionTemplate = "DRIVER={Actual SQL SERVER};SERVER=%1;DATABASE=%2;";
QString connectionString = connectionTemplate.arg("192.168.1.5").arg("Clients");
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName( connectionString );
db.setUserName( "sa" );
db.setPassword( "password" );
if( db.open() )
{
QMessageBox::about( this, tr("Connection"), tr("Connected :)") );
}
however I get the error QODBC3: Unable to connect.
Any ideas what’s wrong?
Turns out this was just some settings that I needed to change with the Actual SQL Server drivers!