[egenix-users] Help Understanding mx.ODBC Error

M.-A. Lemburg mal at egenix.com
Wed Apr 18 23:04:40 CEST 2007


On 2007-04-18 20:31, Greg Corradini wrote:
> Hello All,
> A few weeks ago, I wrote two scripts using mx.ODBC on an Access DB. Among
> other things, both scripts create new tables, performs a query and then
> inserts the tables with data in a dictionary that I've uploaded from
> elsewhere. These scripts have run hundreds of times in the last few weeks
> with no problems.
> 
> But recently they continue to bail on the *mycursor.execute('An SQL
> Statement')* after the table has been created. I get the following error
> message:
> *Traceback (most recent call last):
> File "C:\Documents and Settings\marv1shi\Desktop\Workspace\Existence
> Script\DBF Checker\Access_SQL.py", line 35, in ?
> curse.execute(sql)
> ProgrammingError: ('07001', -3010, '[Microsoft][ODBC Microsoft Access
> Driver] Too few parameters. Expected 4.', 4612)*
> **
> The real stinker, however, is that after it bails I can manually call *
> mycursor.execute('An SQL Statement')*, then call my insert statement* *in
> the Python Shell and it works fine.
> 
> I just can't figure out how to reconcile this problem. Has anybody run into
> this before?

No, but then these things often depend on the version of the ODBC
driver you're using.

Could you provide the SQL in question ? Ie. the statement that leads
to the error ?

Also, you should try to turn of connection pooling in the MS ODBC
manager and see whether that makes a difference - could be that
the two scripts both get shared connections that haven't been
fully reset and then disturb each other.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Apr 18 2007)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611



More information about the egenix-users mailing list