Justin,

I have seen ur post in stackoverflow. in the example its Postgresql 
Database but i am using MySQL as my database.

I changed the line as below

db = QtSql.QSqlDatabase.addDatabase("QMYSQL", "MyDatabaseConnectionName")

and gotthe below error message.

QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE

And in the internet i could not find MySQL driver for PyQt.

I have MySQL Connector <http://www.mysql.com/products/connector/> for 
Python and its working fine for connecting to database with Python.

Do you have and idea If any one have compiled MySQL Connector/Driver for 
PyQt4.

On Thursday, November 1, 2012 10:53:59 PM UTC+5:30, Justin Israel wrote:
>
> I answered a question back in July on Stackoverflow about how to use a 
> QtSql model to populate a QTableView:
> http://stackoverflow.com/a/11624784/496445
>
> You create the database and model, then you set a query on it and select. 
> Any view connected to the model will use that data from the results. You 
> can also tell it which column of results to view, if you are using a 
> list/column view.
>
>
>
> On Thu, Nov 1, 2012 at 12:28 AM, PBLN RAO <[email protected]<javascript:>
> > wrote:
>
>> Hi,
>>
>> I have an application with database.
>>
>> I want to display the data retrieved from database in table view with 
>> column filter option.
>>
>> I know how to do it in .NET. now i need to know how can get it in python.
>>
>> My Database is MySQL. 
>>
>> I have a module to query the database which takes database_name and SQL 
>> command to be executed on that table, and will return the result as 
>> dictionary.
>> This dictionary need to be linked to TableView/Column View which every 
>> suits the best in my scenario.
>>
>> -- 
>> view archives: http://groups.google.com/group/python_inside_maya
>> change your subscription settings: 
>> http://groups.google.com/group/python_inside_maya/subscribe
>>
>
>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to