[PyQt] Re: Build PyQt with sql Driver plugins
Linos
info at linos.es
Thu Sep 27 14:09:26 BST 2007
paulino1 at sapo.pt escribió:
>
> Citando Linos <info at linos.es>:
>
>> Paulino escribió:
>>> Linos escreveu:
>>>> paulino1 at sapo.pt escribió:
>>>>
>>>>> Citando Linos <info at linos.es>:
>>>>>
>>>>>
>>>>>> paulino1 at sapo.pt escribió:
>>>>>>
>>>>>>> Citando Linos <info at linos.es>:
>>>>>>>
>>>>>>>
>>>>>>>> Paulino escribió:
>>>>>>>>
>>>>>>>>> *>Linos* info at linos.es
>>>>>>>>> <mailto:pyqt%40riverbankcomputing.com?Subject=%5BPyQt%5D%20Build%20PyQt%20with%20sql%20Driver%20plugins&In-Reply-To=200709251523.53366.phil%40riverbankcomputing.co.uk>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> />Tue Sep 25 22:21:33 BST 2007/
>>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> The last version in windows works very well for me with odbc
>>>>>>>>>> support
>>>>>>>>>> but i have compilend by hand (sip
>>>>>>>>>> and pyqt, qt installed from binary) i dont know if binary
>>>>>>>>>> packages
>>>>>>>>>> fail, i have a problem with odbc in
>>>>>>>>>> linux but in windows works very well.
>>>>>>>>>>
>>>>>>>>> I have also compiled by hand sip and PyQt, and instaled qt from
>>>>>>>>> binary, but didn't got QODBC available.
>>>>>>>>>
>>>>>>>>> What options did you gave the PyQt's configure.py?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Paulino
>>>>>>>>>
>>>>>>>>>
>>>>>>>> Paulino i am using gcc 3.4.5 from mingw, PyQt-win-gpl-4.3, sip-4.7,
>>>>>>>> python 2.5.1 and
>>>>>>>> qt-win-opensource-4.3.1-mingw, i compile pyqt whithout any
>>>>>>>> options in
>>>>>>>> configure.py, it detects qsql and
>>>>>>>> qodbc while compiling and works ok.
>>>>>>>>
>>>>>>>>
>>>>>>> I used the same packages you refer!
>>>>>>>
>>>>>>> I wonder why it didn't detected QODBC ????
>>>>>>>
>>>>>>> Paulino
>>>>>>>
>>>>>>>
>>>>>> i have in c:\qt\4.3.1\plugins\sqldrivers\ the files:
>>>>>>
>>>>>> libqsqlodbc4.a
>>>>>> qsqlodbc4.dll
>>>>>>
>>>>>> do you have the same?
>>>>>>
>>>>>>
>>>>> Yes, and also:
>>>>> libqsqlite4.a
>>>>> qsqlite4.dll
>>>>>
>>>>> But don't have any driver available.
>>>>>
>>>>> Paulino
>>>>>
>>>>>
>>>>
>>>> i would try recompiling sip and later pyqt, if you have no luck i
>>>> can try in other virtual machine to see
>>>> if it works for me other time.
>>>>
>>>>
>>>>
>>> I tried for 3 times - one on a clean virtual machine. No drivers
>>> available.
>>
>> Paulino i have tried today in a clean virtual machine and it works for
>> me, i have done this:
>>
>> install mingw-5.1.3.exe
>> install qt-win-opensource-4.3.1-mingw.exe
>> install python-2.5.1.msi
>> install pywin32-210.win32-py2.5.exe
>
>
>> add to system path variable:
>> c:\python25;C:\MinGW\libexec\gcc\mingw32\3.4.2;c:\MinGW\bin;C:\Qt\4.3.1\bin
>>
>
> I hadn't add this path :C:\MinGW\libexec\gcc\mingw32\3.4.2
> All the others OK
>
>> cd into sip-4.7 directory:
>> python configure.py
sorry i did too the -p win32-g++, my memory hehehe.
>
> I give the "-p win32-g++" flag to configure.py. (I learn it from PyQt
> wiki : http://www.diotavelli.net/PyQtWiki/BuildPyQt4Windows)
> If i don't I get errors on the make command
>
>> mingw32-make
>> mingw32-make install
>> cd into PyQt-win-gpl-4.3
>> python configure.py
>> mingw32-make
>> mingw32-make install
>>
> Dit it like you!
>
>> And later it works well for me, i have odbc drivers and it works, i
>> connect to an odbc source with this code.
>>
>> -----------------------------------------------------------------------------------------------------------------------------
>>
>> import os, sys
>> from PyQt4.QtCore import *
>> from PyQt4.QtSql import *
>> from PyQt4.QtGui import *
>>
>> def conectarMaxdb():
>> '''conexion via ODBC con QT a MAXDB'''
>> maxdb = QSqlDatabase.addDatabase("QODBC", 'maxdb')
>> maxdb.setDatabaseName("DRIVER={MaxDB
>> (Unicode)};HOSTNAME=192.168.1.20;DATABASE=MAXDB2") --> windows
>> code dsn less
>> maxdb.setUserName("FAKE")
>> maxdb.setPassword("FAKE")
>> aperturamaxdb = maxdb.open()
>> if not aperturamaxdb:
>> QMessageBox.warning(None, "Error conexion con la DB",
>> QString("Database Error:
>> %1").arg(maxdb.lastError().text()))
>> sys.exit(1)
>> return maxdb
>>
>>
>> if __name__ == "__main__":
>> app = QApplication(sys.argv)
>> dbmaxdb = conectarMaxdb()
>> print dbmaxdb.isOpen() -----> print True
>> print dbmaxdb.isValid() ----> print True
>>
>> -----------------------------------------------------------------------------------------------------------------------------
>>
>>
>> I hope this can help you.
>>
>> Best Regards,
>> Miguel Angel.
>>
>
> I'll try once more with pywin32-210.win32-py2.5.exe installed, that
> hadn't last time, although I haven't seen any reference to it related to
> PyQt...
>
> Thank you very much for your help!
>
> Paulino
>
I dont know if wiw32com is important but i install it ever and i want to explain you the complete steps i
have done so you can do the exactly same steps. Good luck.
More information about the PyQt
mailing list