Hi, I create an application in Windows and works fine, now I'm trying to make it work on a mac with MacOS 10.4, with the proper adjustments the program is complied but I'm having problems with the database connection.
I'm trying to connect to a SQL Server database, I'm using de QODBC driver, the problem is that i'm trying to select from a table some information, but when I use a variable from a class I create the program stops working, but if I substitute the variable with a QString works fine.
This is the code that isn't working in the Mac, works fine in Windows.
QSqlQuery query
("Select * from table1 where name='" + obj.
getName() + "'",db
);
QSqlQuery query ("Select * from table1 where name='" + obj.getName() + "'",db);
To copy to clipboard, switch view to plain text mode
This is the code that works fine in Mac
QSqlQuery query
( "Select * from table1 where name='Carlos'",db
);
QSqlQuery query( "Select * from table1 where name='Carlos'",db);
To copy to clipboard, switch view to plain text mode
I if do this works fine too.
QSqlQuery query
( "Select * from table1 where name='" + name
+ "'",db
);
QString name = "Carlos";
QSqlQuery query( "Select * from table1 where name='" + name + "'",db);
To copy to clipboard, switch view to plain text mode
Could this be a problem in the definition of the method getName in the class???
Bookmarks