[DB-SIG] Acessing DBISAM files via mxODBC

M.-A. Lemburg mal@lemburg.com
Sun, 11 Feb 2001 22:20:12 +0100


Kent Tenney wrote:
> 
> Marc-Andre,
> 
> Thanks for the prompt reply.
> I ran python -d test_db.py
> this is the contents of test_db.py;
> 
> import ODBC.Windows as odbc
> con = odbc.Connect('photos', user='', password='')
> cur = con.cursor()
> cur.execute('select * from SPM_Link')
> 
> I see from the log file that the program knows about the
> data in the file. Is there another way to execute an SQL statement
> other than as a cursor method?

No, you always have to use a cursor (ODBC requires this).

Are you sure that the above script does not run ? The log
indicates that the .execute() ran just fine... (otherwise
the log file wouldn't contain the prepare output lines) ?!

> Thanks,
> Kent
> 
> This the resulting mxODBC.log
> 
> --- New Log Session --- Sun Feb 11 12:09:15 2001
> 
> Importing the DateTime C API...
>  module found
>  API object found
>  API object initialized.
> sizeof(mxODBCursor_Variable)=76
> mxODBC_New: server='photos', uid='', passwd='', clearAC=1
> mxODBC_New: created new connection at 0x7ba170
> mxODBCursor_New: created new cursor '<no name>' at 0x7ba010
> mxODBCursor_Execute: preparing statement 'select * from SPM_Link'
> mxODBCursor_Execute: number of params in statement: 0
> mxODBCursor_Execute: executing command without parameters
> mxODBCursor_FreeVars: called for cursor at 0x7ba010
> mxODBCursor_PrepareOutput: colcount=2 rowcount=11809
> mxODBCursor_PrepareOutput: column 0: name='FileID' type=4 precision=4 scale=0 nullable=1
> mxODBCursor_PrepareOutput: column 1: name='KeywordID' type=4 precision=4 scale=0 nullable=1
> mxODBCursor_Free: called for cursor at 0x7ba010
> mxODBCursor_FreeVars: called for cursor at 0x7ba010
> mxODBCursor_FreeVars:  freeing output variable array
> mxODBCursor_FreeParameters: called for cursor at 0x7ba010
> mxODBCursor_Close: called for cursor at 0x7ba010
> mxODBCursor_Close:   error cancelling; rc=-1mxODBCursor_Close:   stmt freed
> mxODBC_Free: called for connection at 0x7ba170
> mxODBC_Close: called for connection at 0x7ba170, closed=0
> mxODBC_Close:  disconnect
> mxODBC_Close:  free connection

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/