[DB-SIG] Acessing DBISAM files via mxODBC
Kent Tenney
kent@springfed.com
Sun, 11 Feb 2001 14:00:02 -0600
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?
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
On Sun, 11 Feb 2001 15:48:41 +0100, M.-A. Lemburg wrote:
Kent Tenney wrote:
>
> Howdy,
>
> I have data in DBISAM files which I'd like to access via=
Python.
>
> I have installed an ODBC driver for DBISAM;
> http://www.elevatesoft.com/download/odbc.zip,
> found at http://www.elevatesoft.com/usercode.htm
>
> and mxODBC; http://www.lemburg.com/files/python/mxODBC.html
>
> this is my program;
> import ODBC.Windows as odbc
>
> con =3D odbc.Connect('photos', user=3D'', password=3D'')
> cur =3D con.cursor()
>
> --it seems OK at this point;
> >>> cur
> <mxODBC Cursor object at 016F9570>
>
> I am unable to do anything with the cursor, I keep getting the
> parameter mismatch message.
>
> >>> cur.execute('select * from datafile')
> Traceback (innermost last):
> File "<interactive input>", line 1, in ?
> InterfaceError: mismatch in number of parameters; expected 63,=
found none
>
> I don't understand this error message.
>
> Is the driver just incompatable with the mxODBC module?
>
> Any suggestions?
Could you send the mxODBC.log which is generated by mxODBC
when Python is run in debug mode (python -d) ? This should
give some insights into why the interface expects 63
parameters :-) -- this looks like a bug in the ODBC driver...
--
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