[Qt-interest] MSSQL Mac query

Wolfgang Kriener wkriener at fms-computer.de
Fri Jul 24 16:21:44 CEST 2009


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();
}
...

> On Fri, Jul 24, 2009 at 8:01 AM, Wolfgang Kriener <wkriener at fms-computer.de 
> > wrote:
> My Question on using QODBC with Mac OS X to connect to MSSQL server
> is partly answered.
>
> When using SqlQuery and set forwardOnly to true
> in the following i can exec query and step through the results.
>
> Using  QSqlTableModel after call "model->select()" model reports
> following error:
> " [Actual][SQL Server] Unclosed quotation mark after the character
> string 'I'. QODBC3: Unable to execute statement"
>
> any ideas?
>
>
> Wolfgang
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
>
> -- 
> Nehemiah I. Dacres
> Secretary
> Math and Computer Science Club





More information about the Qt-interest-old mailing list