Menu

#7 Set ODBC version when connecting

open
nobody
None
3
2008-02-11
2006-04-27
Anonymous
No

When using PyDB2 from mod_python, it can not connect to
a database without setting the ODBC version.

netreg@tritonhq.hu

Discussion

  • Zoltan Felleg

    Zoltan Felleg - 2006-04-27

    Logged In: YES
    user_id=98109

    sorry, i could'nt attach the patch as a file, so here it is:

    *** PyDB2-1.1.0/_db2_module.c 2005-08-02
    10:06:17.000000000 +0200
    --- _db2_module.c.patched 2006-04-27
    22:06:06.000000000 +0200
    ***************
    *** 606,611 ****
    --- 606,616 ----

    rc = SQLAllocHandle( SQL_HANDLE_ENV,
    SQL_NULL_HANDLE, &c->henv );

    + rc = SQLSetEnvAttr( c->henv,
    + SQL_ATTR_ODBC_VERSION,
    + (SQLPOINTER) SQL_OV_ODBC3,
    + 0);
    +
    rc = SQLAllocHandle( SQL_HANDLE_DBC, c->henv,
    &c->hdbc );

    rc = SQLSetConnectAttr( c->hdbc,

     
  • Jon Thoroddsen

    Jon Thoroddsen - 2008-02-11

    Logged In: YES
    user_id=2003727
    Originator: NO

    We're not going to do this right now, as I think the correct way to do this is to wrap the db2 driver on a lower level in much the same way that the ruby-db2 DBI does it. I.e. we should wrap SQLAllocHandle, SQLSetEnvAttr in python and then it's easy to do this from python.

     
  • Jon Thoroddsen

    Jon Thoroddsen - 2008-02-11
    • priority: 5 --> 3
     

Log in to post a comment.