[egenix-users] Open and Closing mxodbcZopeda via script

Steve Holden sholden at holdenweb.com
Tue Jun 15 21:03:58 CEST 2004


Jerome R. Westrick wrote:

>Can someone tell me how to open, and 
>close connections within a python script?
>
>Can't seem to manage it...
>
>Jerry
>  
>
I use something like

import mx.ODBC.Windows as db
conn = db.connect("sitedata")
curs = conn.cursor()
    ...
conn.close()

where "sitedata"  is a defined ODBC Data Source Name in Windows 
connection manager.

Now I guess you'll tell me you meant Linux ...

You can also use the DriverConnect() method to use DSN-less connections.

regards
 Steve



More information about the egenix-users mailing list