PDA

View Full Version : Windows to Mac Migration



davidpiedra
11th November 2010, 17:01
Hello, I have a simple application programed in windows works great. This app connects to a SQL SERVER Database.

Now I need to compile and install this application on a Mac computer running MAC OS X.

I installed all I need to compile in a Mac computer, and installed the Actual Sql Driver for the Database connection.

Without much changes the application compile fine in the Mac, but there is a problem with the database connection.

Now here is the problem, when I retrieve data from the database and save it on a QString, it saves nothing. If i use qDebug to print what's on the QString appears only one " not even two "", here's teh part of my code.

qSqlQuery q("Select * from table");

if ( q.isActive() ) {
if ( q.isValid() ) {
qDebug() <<q.value(0).toString().trimmed();
SQtring s = q.value(0).toString().trimmed();
qDebug()<< s;
}
}

This prints on a application output a " and in the next line another ".

What seems curious to me is that if I use a MessageBox to print the q.value it prints well on the messagebox.

QMessageBox::information( 0, "The Message", q.value(0).toString().trimmed());

Like I said, this works fine in windows. Should work fine in Mac too, right? Or am I missing something?

Thanks for your reply,

David