We have many Sybase databases of both flavors (ASE and Anywhere). For some reason, my boss insists on accessing them via ODBC (on Linux). I am able to access them via the native sybpydb and sqlanydb without too much of a problem. For ASE I tried to go to the pyodbc using this connection string:
CONNECTSTR = driver={/opt/sybase/default/OCS/python/python34_64r/lib/sybpydb.so};DATABASE=dbname;server=SERVERNAME;uid=my_uid;pwd=...
As you see, I provided the name of the native driver, fully qualified, because the documentation states (perhaps I misunderstood it) that it is the same driver. I have SYBASE_HOME set to /opt/sybase/default and PYTHONPATH set to /opt/sybase/default/OCS/python/python34_64r/lib; both are correct.
I get:
('IM004', "[IM004] [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnect)")
For the Anywhere, I have no idea what the driver would be and where does it reside, and also, I must provide hos:port, so I am not sure how to deal with that.
After that I have to do same for the Oracle database, and I have no clue how to address that (I access the Oracle via the native cx_Oracle without any issue).
And, same with SQLite.
Please, could anybody guide me where to look.
Thanks
ZA
I would like to add an emphasis to the question about SQLite via ODBC. The site https://wiki.python.org/moin/ODBCDrivers does NOT even mention SQLite
CONNECTSTR = driver={/opt/sybase/default/OCS/python/python34_64r/lib/sybpydb.so};DATABASE=dbname;server=SERVERNAME;uid=my_uid;pwd=...
As you see, I provided the name of the native driver, fully qualified, because the documentation states (perhaps I misunderstood it) that it is the same driver. I have SYBASE_HOME set to /opt/sybase/default and PYTHONPATH set to /opt/sybase/default/OCS/python/python34_64r/lib; both are correct.
I get:
('IM004', "[IM004] [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnect)")
For the Anywhere, I have no idea what the driver would be and where does it reside, and also, I must provide hos:port, so I am not sure how to deal with that.
After that I have to do same for the Oracle database, and I have no clue how to address that (I access the Oracle via the native cx_Oracle without any issue).
And, same with SQLite.
Please, could anybody guide me where to look.
Thanks
ZA
I would like to add an emphasis to the question about SQLite via ODBC. The site https://wiki.python.org/moin/ODBCDrivers does NOT even mention SQLite