Loprz / pypyodbc

Automatically exported from code.google.com/p/pypyodbc
0 stars 0 forks source link

Error SQL_INVALID_HANDLE trying to connect a Progress/Openedge database. #39

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run pypy
2. Import pypyodbc
3. Connect to a DSN (working under cPython+pyodbc)

What is the expected output? What do you see instead?
==========================
Error:
--------------------------
$ pypy
Python 2.7.3 (87aa9de10f9ca71da9ab4a3d53e0ba176b67d086, Nov 28 2013, 12:34:23)
[PyPy 2.2.1 with GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``"You know what's nice about
RPython?  Longer sword fights."''
>>>> import pypyodbc
>>>> pypyodbc.connect("DSN=pyProgress")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/pypy/site-packages/pypyodbc.py", line 2402, in __init__
    AllocateEnv()
  File "/opt/pypy/site-packages/pypyodbc.py", line 995, in AllocateEnv
    check_success(SQL_NULL_HANDLE, ret)
  File "/opt/pypy/site-packages/pypyodbc.py", line 989, in check_success
    ctrl_err(SQL_HANDLE_ENV, ODBC_obj, ret, False)
  File "/opt/pypy/site-packages/pypyodbc.py", line 969, in ctrl_err
    raise ProgrammingError('', 'SQL_INVALID_HANDLE')
ProgrammingError: ('', 'SQL_INVALID_HANDLE')
>>>>

==========================
Expected (using cPython):
--------------------------
$ python
Python 2.7.2 (default, Jun 19 2012, 12:13:20)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyodbc
>>> pyodbc.connect("DSN=pyProgress")
<pyodbc.Connection object at 0x7f693e285ed0>
>>>

What version of the product are you using? On what operating system?
- pypyodbc 1.3.1
- Mandriva Linux 2011.0 (turtle)

Please provide any additional information below.
- currently using driver libodbc.so.1 from unixodbc

Original issue reported on code.google.com by ca...@iv-srl.it on 17 Mar 2014 at 6:08

GoogleCodeExporter commented 8 years ago
is this related to pypy only or pypyodbc has the same problem on cpython?

Original comment by jiangwen...@gmail.com on 19 Mar 2014 at 5:22

GoogleCodeExporter commented 8 years ago
Has the same problem on cpython:
==================
$ python
Python 2.7.2 (default, Jun 19 2012, 12:13:20)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyodbc
>>> import pypyodbc
>>> pyodbc.connect("DSN=pyProgress")
<pyodbc.Connection object at 0x7f61f93b4c60>
>>> pypyodbc.connect("DSN=pyProgress")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pypyodbc-1.3.1-py2.7.egg/pypyodbc.py", line 2402, in __init__
    AllocateEnv()
  File "/usr/lib/python2.7/site-packages/pypyodbc-1.3.1-py2.7.egg/pypyodbc.py", line 995, in AllocateEnv
    check_success(SQL_NULL_HANDLE, ret)
  File "/usr/lib/python2.7/site-packages/pypyodbc-1.3.1-py2.7.egg/pypyodbc.py", line 989, in check_success
    ctrl_err(SQL_HANDLE_ENV, ODBC_obj, ret, False)
  File "/usr/lib/python2.7/site-packages/pypyodbc-1.3.1-py2.7.egg/pypyodbc.py", line 969, in ctrl_err
    raise ProgrammingError('', 'SQL_INVALID_HANDLE')
pypyodbc.ProgrammingError: ('', 'SQL_INVALID_HANDLE')
>>>

Original comment by ca...@iv-srl.it on 19 Mar 2014 at 8:35

GoogleCodeExporter commented 8 years ago
Have just run into this same error.

Python 3.4.1 (Win32)
pypyodbc 1.3.3

Have executed several queries, but then this one I've been fighting with, and 
thought I'd finally got working, results in this [very unhelpful] error message.

Original comment by cur...@tinbrain.net on 18 Jul 2014 at 3:33