On Dec 6, 5:15 pm, mkleehammer <
mkleeham...@gmail.com> wrote:
> Can you turn on ODBC tracing and make the connection with Perl and
> then pyodbc so I can compare?
Hm. I've tried turning on the tracing, but I believe that reports back
the same issues as pyodbc did:
[ODBC][25275][__handles.c][444]
Exit:[SQL_SUCCESS]
Environment = 0x9d428d0
[ODBC][25275][SQLSetEnvAttr.c][182]
Entry:
Environment = 0x9d428d0
Attribute = SQL_ATTR_ODBC_VERSION
Value = 0x3
StrLen = -6
[ODBC][25275][SQLSetEnvAttr.c][349]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLAllocHandle.c][345]
Entry:
Handle Type = 2
Input Handle = 0x9d428d0
[ODBC][25275][SQLAllocHandle.c][463]
Exit:[SQL_SUCCESS]
Output Handle = 0x9e59f90
[ODBC][25275][SQLDriverConnect.c][678]
Entry:
Connection = 0x9e59f90
Window Hdl = (nil)
Str In = [gupta1][length = 6]
Str Out = 0xbfc999c8
Str Out Max = 2048
Str Out Ptr = 0xbfc999c2
Completion = 0
[ODBC][25275][SQLDriverConnect.c][1085]Error: IM002
[ODBC][25275][SQLError.c][424]
Entry:
Connection = 0x9e59f90
SQLState = 0xbfc9973a
Native = 0xbfc99740
Message Text = 0xbfc99748
Buffer Length = 511
Text Len Ptr = 0xbfc99746
[ODBC][25275][SQLError.c][461]
Exit:[SQL_SUCCESS]
SQLState = IM002
Native = 0xbfc99740 -> 0
Message Text = [[unixODBC][Driver Manager]Data source name not
found, and no default driver specified]
[ODBC][25275][SQLError.c][424]
Entry:
Connection = 0x9e59f90
SQLState = 0xbfc9973a
Native = 0xbfc99740
Message Text = 0xbfc99748
Buffer Length = 511
Text Len Ptr = 0xbfc99746
[ODBC][25275][SQLError.c][461]
Exit:[SQL_NO_DATA]
[ODBC][25275][SQLConnect.c][3549]
Entry:
Connection = 0x9e59f90
Server Name = [gupta1][length = 6]
User Name = [SYSADM][length = 6]
Authentication = [******][length = 6]
UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 'UCS-2LE'
[ODBC][25275][SQLConnect.c][4123]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLSetConnectOption.c][262]
Entry:
Connection = 0x9e59f90
Option = SQL_ATTR_AUTOCOMMIT
Value = 1
[ODBC][25275][SQLSetConnectOption.c][525]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLGetInfo.c][214]
Entry:
Connection = 0x9e59f90
Info Type = SQL_DRIVER_ODBC_VER (77)
Info Value = 0x9db5624
Buffer Length = 20
StrLen = 0xbfc999c6
[ODBC][25275][SQLGetInfo.c][528]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLGetInfo.c][214]
Entry:
Connection = 0x9e59f90
Info Type = SQL_DBMS_NAME (17)
Info Value = 0x9db5638
Buffer Length = 64
StrLen = 0xbfc999c6
[ODBC][25275][SQLGetInfo.c][528]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLGetFunctions.c][147]
Entry:
Connection = 0x9e59f90
Id = SQLMoreResults
Supported = 0xbfc999c4
[ODBC][25275][SQLGetFunctions.c][182]
Exit:[SQL_SUCCESS]
Supported = 0xbfc999c4 -> 1
[ODBC][25275][SQLGetFunctions.c][147]
Entry:
Connection = 0x9e59f90
Id = SQLDescribeParam
Supported = 0xbfc999c4
[ODBC][25275][SQLGetFunctions.c][182]
Exit:[SQL_SUCCESS]
Supported = 0xbfc999c4 -> 0
[ODBC][25275][SQLSetConnectOption.c][262]
Entry:
Connection = 0x9e59f90
Option = SQL_ATTR_AUTOCOMMIT
Value = 1
[ODBC][25275][SQLSetConnectOption.c][525]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLGetConnectOption.c][219]
Entry:
Connection = 0x9e59f90
Option = SQL_ATTR_AUTOCOMMIT
Value = 0xbfc9a2d8
[ODBC][25275][SQLGetConnectOption.c][499]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLDisconnect.c][204]
Entry:
Connection = 0x9e59f90
[ODBC][25275][SQLDisconnect.c][341]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLFreeHandle.c][268]
Entry:
Handle Type = 2
Input Handle = 0x9e59f90
[ODBC][25275][SQLFreeHandle.c][317]
Exit:[SQL_SUCCESS]
[ODBC][25275][SQLFreeHandle.c][203]
Entry:
Handle Type = 1
Input Handle = 0x9d428d0
If you see there at entry 461:
[ODBC][25275][SQLError.c][461]
Exit:[SQL_SUCCESS]
SQLState = IM002
Native = 0xbfc99740 -> 0
Message Text = [[unixODBC][Driver Manager]Data source name not
found, and no default driver specified]
That was basically the same error I got in PyODBC.
But ODBC works from all other tools, like:
$ odbcinst -q -s
[gupta1]
$ odbcinst -j
unixODBC 2.2.11
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
USER DATA SOURCES..: /home/marius/.odbc.ini
$ odbcinst -q -d
[Gupta SQLBase]
$ cat /etc/odbcinst.ini
[Gupta SQLBase]
Driver = /tmp/gupta/libsqlbaseodbc.so
Setup = /tmp/gupta/libsqlbaseodbcsetup.so
[ODBC]
Trace = yes
TraceFile = /tmp/sql.log
$ cat /etc/odbc.ini
[gupta1]
Driver=/tmp/gupta/libsqlbaseodbc.so
Description=Gupta SQLBase DSN
DSN=gupta1
Servername=server1
LoginID=SYSADM
Username=SYSADM
Password=SYSADM
Database=RB3
ini=/tmp/gupta/sql.ini
InputMessageSize=2000
IsoLevel=Release Locks
LockTimeOut=300
$ cat .odbc.ini
[gupta1]
Driver=/tmp/gupta/libsqlbaseodbc.so
Description=Gupta SQLBase DSN
DSN=gupta1
Servername=server1
LoginID=SYSADM
Username=SYSADM
Password=SYSADM
Database=RB3
ini=/tmp/gupta/sql.ini
InputMessageSize=2000
IsoLevel=Release Locks
LockTimeOut=300
- Marius