Python adodb

LenS lsumnler at
Thu Oct 13 03:29:15 CEST 2005

I have used the following code in ADO:

# The following code creates a connection object,
# assigns the connection string, opens the
# connection object, and then verifies a good
# connection.

oConn = Dispatch('ADODB.Connection')

oConn.ConnectionString = "Provider=SQLOLEDB.1;" +\
                         "Data Source=servername;" +\
                         "uid=loginid;" +\
                         "pwd=password;" +\

if oConn.State == adStateOpen:
    print "Database connection SUCCEEDED"
    print "Database connection FAILED"

Hope this helps

More information about the Python-list mailing list