Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > adodbapi integer parameters and MS Access

Reply
Thread Tools

adodbapi integer parameters and MS Access

 
 
Joe
Guest
Posts: n/a
 
      03-13-2011
Here is my environment:

Windows 7 x64 SP1
Python 3.2
adodbapi 2.4.2
MS Access

Although the above environment is what I am currently using I have
encountered this same problem with Python 3.1.1. It is not a problem
with Python 2.x.

The problem is as follows:

If you are using a select statement like:

select col_1, col_2 from table where (col_1 = ?)

and you are using the qmark parameter style

and you pass in an integer (for example: (1, )) for the parameters,
you get the following error:

(-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB Provider
for ODBC Dri
vers', '[Microsoft][ODBC Microsoft Access Driver]Optional feature not
implemente
d ', None, 0, -2147217887), None)
Command:

select col_1, col_2 from table where (col_1 = ?)

Parameters:
[Name: p0, Dir.: Input, Type: adBigInt, Size: 0, Value: "1",
Precision: 0, Numer
icScale: 0]


If you run the same code using pyodbc or odbc in Python 3.2 (or 3.1.1)
it works fine so I know it is not a problem with the ODBC driver.

If you run the same code in Python 2.6.2 and adodbapi it also runs
fine.

Further investigation using different tables and columns seems to
conclude that:

adodbapi + Python 3.x + qmark parameters + parameters that are
integers produces this error.

col_1 in the database is defined as a number (long integer with 0
decimal positions).

If you convert the parameter to a string (str(1), ) then adodbapi
works in Python 3.2.

Is this a known bug?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adodbapi and output parameters in stored procedures leesquare@yahoo.com Python 4 11-08-2008 02:25 PM
ImportError...pdo and adodbapi Kathryn Python 2 08-18-2004 04:40 PM
adodbapi, exception/error handling question Raaijmakers, Vincent \(GE Infrastructure\) Python 0 01-20-2004 09:02 PM
[adodbapi] cannot create table Sangbae Python 3 10-07-2003 04:47 PM
adodbapi / string encoding problem Achim Domma Python 10 09-26-2003 10:39 AM



Advertisments