Help Understanding mx.ODBC Error

G

Greg Corradini

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, perform a query and then
populate 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?

Thanks
Greg Corradini
 
K

kyosohma

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, perform a query and then
populate 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?

Thanks
Greg Corradini

Normally too few parameters refers to the SQL statement not inserting
the proper number of items. An example would be to list 4 values and
only insert 3. See below for a pseudo-SQL statement:

INSERT into someDB (id, name, address, state) VALUES (value1, value2,
value3)

That should give the same error, I would think. You may need to check
if your SQL statement or the way your db is created has changed in
some way.

Mike
 
G

Greg Corradini

Thanks for you help kyosohma,
Unfortunately, the data I'm using isn't chaning either. I've reused data
that these scripts have successfully used before, but that won't work with
them now.

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, perform a query and then
populate 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?

Thanks
Greg Corradini

Normally too few parameters refers to the SQL statement not inserting
the proper number of items. An example would be to list 4 values and
only insert 3. See below for a pseudo-SQL statement:

INSERT into someDB (id, name, address, state) VALUES (value1, value2,
value3)

That should give the same error, I would think. You may need to check
if your SQL statement or the way your db is created has changed in
some way.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top