Bobspadger / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Connect: pyodbc.Error: ('0', '[0] [nxDC (202) (SQLDriverConnectW)') #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by terminatorul@gmail.com on 27 Aug 2009 at 2:03

Attachments:

GoogleCodeExporter commented 9 years ago
Running python tests/dbapitests.py also failes with the same error

Original comment by terminatorul@gmail.com on 27 Aug 2009 at 2:12

GoogleCodeExporter commented 9 years ago
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 ?

Original comment by terminatorul@gmail.com on 5 Sep 2009 at 2:48

GoogleCodeExporter commented 9 years ago
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.)

Original comment by mkleehammer on 5 Sep 2009 at 4:47

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 21 Nov 2010 at 4:44