How to access ODBC databases ?

Martin P. Hellwig martin.hellwig at dcuktec.org
Fri Sep 4 16:45:13 EDT 2009


Timothy Madden wrote:
> Martin P. Hellwig wrote:
>> Timothy Madden wrote:
>> <cut>
>>>  >>> conn = pyodbc.connect('DRIVER={PostgreSQL 
>>> Unicode};Servername=127.0.0.1;UID=pikantBlue;Database=pikantBlue')
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in <module>
>>
>>> pyodbc.Error: ('0', '[0] [nxDC (202) (SQLDriverConnectW)')
>>
>> Not sure (i.e. wild guess) but that line makes me think it has 
>> something to do with the encoding, is it possible to try a different 
>> driver?
>>
> Thank you.
> 
> Slackware also comes with mysql, I guess I could try to install and 
> register a driver for it in my unixODBC installation.
> 
> What about the encoding ? What should I be looking for in this case ?
> Indeed when I try
>    createdb --encoding=UTF-8 pikantBlue
> I get the message that the server's /LC_TYPE settings require encoding 
> to be LATIN1/. What should I do about it ? Should I have been more 
> careful about the configure options when compiling postgresql ? I also 
> tried pyodbc on Ubuntu with the database installed with apt-get and I 
> still get the same problem.
> 
> Thank you
> Timothy Madden

According to this:
http://psqlodbc.projects.postgresql.org/faq.html#2.5
You could try the 'PostgreSQL ANSI' driver.

-- 
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'



More information about the Python-list mailing list