[Qt-interest] MSSQL Mac query
Stephen Jackson
spjackson42 at gmail.com
Fri Jul 24 16:43:56 CEST 2009
On Fri, Jul 24, 2009 at 3:21 PM, Wolfgang Kriener wrote:
>
> Am 24.07.2009 um 15:46 schrieb Nehemiah Dacres:
>
>> perhaps you should give us more context
>
> thank you for being interested.
>
> i use Mac OS 10.5.7, QT 4.5.2, Actual ODBC driver v. 2.9b
>
> i built plugin-sql-odbc using Macs builtin iodbc library and builtin
> headers
>
> here is what i did:
>
> ...
> db = QSqlDatabase::addDatabase("QODBC");
> QString s = "DRIVER={Actual SQL
> Server};SERVER=myServerIP;UID=myUser;PWD=myWord;DATABASE=myDatabase";
> db.setDatabaseName( s );
> db.setConnectOptions("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3");
> if (db.open()) {
> model = new QSqlTableModel(this, db);
> model->setTable("TestTable");
> model->setHeaderData(0, Qt::Horizontal, tr("I3D"));
> ... some other headers
>
> bool myBool = model->select();
> QString myError = model->lastError().text();
> }
> ...
>
What does model->query().lastQuery() give you? This should help to see
what's going on.
Regards,
Stephen Jackson
More information about the Qt-interest-old
mailing list