adodbapi integer parameters and MS Access

Discussion in 'Python' started by Joe, Mar 13, 2011.

  1. Joe

    Joe Guest

    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?
    Joe, Mar 13, 2011
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Achim Domma

    adodbapi / string encoding problem

    Achim Domma, Sep 25, 2003, in forum: Python
    Replies:
    10
    Views:
    759
    Alex Martelli
    Sep 26, 2003
  2. Sangbae

    [adodbapi] cannot create table

    Sangbae, Oct 6, 2003, in forum: Python
    Replies:
    3
    Views:
    560
    Bob Gailer
    Oct 7, 2003
  3. Raaijmakers, Vincent \(GE Infrastructure\)

    adodbapi, exception/error handling question

    Raaijmakers, Vincent \(GE Infrastructure\), Jan 20, 2004, in forum: Python
    Replies:
    0
    Views:
    433
    Raaijmakers, Vincent \(GE Infrastructure\)
    Jan 20, 2004
  4. Kathryn

    ImportError...pdo and adodbapi

    Kathryn, Jul 30, 2004, in forum: Python
    Replies:
    2
    Views:
    1,010
    Kathryn
    Aug 18, 2004
  5. Replies:
    4
    Views:
    542
    M.-A. Lemburg
    Nov 8, 2008
Loading...

Share This Page