[Qt-interest] MSSQL Mac query
Sylvain Pointeau
sylvain.pointeau at gmail.com
Fri Jul 24 16:37:16 CEST 2009
Yes I succeed to access a SQLServer 2005 database with unixodbc and the
nighly build of FreeTDS
it worked well..
Cheers,
Sylvain
On Fri, Jul 24, 2009 at 4:21 PM, Wolfgang Kriener
<wkriener at fms-computer.de>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();
> }
> ...
>
> > 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
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090724/5f9d1715/attachment.html
More information about the Qt-interest-old
mailing list