Issue 69: Connect: pyodbc.Error: ('0', '[0] [nxDC (202) (SQLDriverConnectW)')
Status:  Complete
Owner: ----
Closed:  Sep 2009
Reported by terminatorul@gmail.com, Aug 27, 2009
What steps will reproduce the problem?
1. Install unixODBC 2.2.14 with psqlodbc-08_03_0400
2. create a data source and check that it can be accessed with isql
3. connect to the datasource with pyodbc 2.1.6

What is the expected output? What do you see instead?

Insetad of connecting to the data source I get a pyodbc.Error 
exception in python at he connect(...) function call saying
[0] [nxDC (202) (SQLDriverConnectW)

What version of the product are you using? On what operating system?

I have Slackware Linux:

adrian@darkstar:~/packages/unixODBC-2.2.14$ uname -a
Linux darkstar 2.6.30 #1 Mon Jun 22 21:38:25 EEST 2009 i686 AMD Sempron(tm)
2200+ AuthenticAMD GNU/Linux


Please provide any additional information below.
I have compiled versions of unixODBC, psqlodbc, python2.6 and pyodbc

 isql pikantBlue pikantBlue 
works just fine and I can execute queries at the isql command prompt.
But when I write a python script and call 
 pyodbc.connect('DSN=pikantBlue;UID=pikantBlue;PWD=')
then I get the above error.

Also if I connect with pyodb instead of pyodbc (pyodbc is another python
module for access to ODBC drivers and their databases) than I can connect.
I also tried pyodbc on two other computers with Ubuntu and I get the same
problem. Can anyone please help ? I could not find the error with Google

sh_session.txt
1.3 KB   View   Download
Aug 27, 2009
#1 terminatorul@gmail.com
Running python tests/dbapitests.py also failes with the same error
Sep 5, 2009
#2 terminatorul@gmail.com
I find that if I use the ANSI version of the psqlodbc driver than I can connect
successfully. Do you know why the Unicode driver won't work with pyodbc ?
Sep 5, 2009
Project Member #3 mkleehammer
The ANSI and Unicode functions are separate functions, so usually it means either 
the driver doesn't have the functions or there are bugs in one but not the other.

Since it works for you, I'm going to close this out, but it is still searchable for 
others having the same issue.  Thanks for reporting what you found.

By the way, using the ANSI connect doesn't mean you can't read and write Unicode 
values, it just means it uses SQLDriverConnectA instead of SQLDriverConnectW.  
(Though some drivers do notice which you use and change their behavior.)
Status: Done
Nov 21, 2010
Project Member #4 mkleehammer
(No comment was entered for this change.)
Status: Complete