adodbapi help needed

I

Ian Hobson

Hi all,

I am just starting to learn Python and I have a setup problem - I think.
Python 3.1.

I have a small test script that is not working as expected.

Start script-----------
# coding=utf8
import adodbapi
connectString = (
"DRIVER={MySQL ODBC 5.1 Driver} ;"
"SERVER=127.0.0.1;"
"PORT=3306;"
"DATABASE=moschatel;"
"USER=Moschatel;"
"PASSWORD=badger43time;"
"OPTION=3;"
)
# MySQL ODBC 5.1 Driver - version 5.01.06.00 is installed
db = adodbapi.connect(connectString)
------------end script --------------

I get an error message that reads
D:\websites\moschatel\sop\Printing>test.py
Traceback (most recent call last):
File "D:\websites\moschatel\sop\Printing\test.py", line 13, in <module>
db = adodbapi.connect(connectString)
AttributeError: 'module' object has no attribute 'connect'

Now, adodbapi is installed into
D:\websites\moschatel\sop\Printing\adodbapi

and contains file adodbapi.py, and line 279 reads

def connect(connection_string, timeout=30):

I expected that to be called.

What have I missed?

Regards

Ian
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top