[PyQt] QSqlDatabase connect MsSQL2008 in Linux

David Boddie david at boddie.org.uk
Sat May 14 13:50:37 BST 2011


On Mon May 9 01:57:17 BST 2011, Luan Mai wrote:

> I am having issue with PyQt connecting to MsSQL database. I am able to run
> update query, but not able to select query. When ever I run select, it
> always return empty list. I am using the same code but connect to MySQL or
> Sqlite, they are all ok. Does anyone have same issue?
>
> (I am using PyQt-4.8.1, running on slackware linux. )

Which SQL driver are you using to access the database? QODBC? It might
be worth looking at this documentation, though I'm not sure if it will
explain the behaviour you are seeing:

  http://doc.qt.nokia.com/4.7/sql-driver.html#qodbc

It might be worth checking that you can access the database using another
Python module. This module looks like it might be helpful:

  http://code.google.com/p/pymssql/

David


More information about the PyQt mailing list