[DB-SIG] Acessing DBISAM files via mxODBC

Kent Tenney kent@springfed.com
Sun, 11 Feb 2001 21:03:19 -0600


Marc-Andre,

This is the first time I've run from the command line, I was=
 getting
errors when I ran the cur.execute('SQL...') from the interactive=
 window
of ActiveState Python.

It does look like I have a cursor which is hooked to the data=
 OK.

Is it common to get different results from interactive Pythonwin=
 and 
sending a file to python.exe?

Thanks,
Kent




On Sun, 11 Feb 2001 22:20:12 +0100, M.-A. Lemburg wrote:
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 =3D odbc.Connect('photos', user=3D'', password=3D'')
> cur =3D 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)=3D76
> mxODBC_New: server=3D'photos', uid=3D'', passwd=3D'', clearAC=3D1
> 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=3D2 rowcount=3D11809
> mxODBCursor_PrepareOutput: column 0: name=3D'FileID' type=3D4=
 precision=3D4 scale=3D0 nullable=3D1
> mxODBCursor_PrepareOutput: column 1: name=3D'KeywordID' type=3D4=
 precision=3D4 scale=3D0 nullable=3D1
> 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=3D-1mxODBCursor_Close: =
  stmt freed
> mxODBC_Free: called for connection at 0x7ba170
> mxODBC_Close: called for connection at 0x7ba170, closed=3D0
> 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/

_______________________________________________
DB-SIG maillist  -  DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig