Microsoft Access Database connecting from Python through ODBC

Jeremie jivesojer at hotmail.com
Mon Dec 9 13:24:59 EST 2002


So far we are all off the right path... I have tried everything and nothing
works... Although it works from IDLE, PythonWin, and command line it does
not work from the CGI script. Right from the beginning I felt it had
something to do with the pass between HTTP(daemon, IIS) to the CGI script
handler Python. My first assumption was that the default username and
password weren't that of the logged on user. Even so this would not matter
because the configuration allows the system full access to the files.......
Upon probing some more I found that apparently the HTTP daemon does not send
correct path information to the python shell handling the request (I found
this at http://www.egenix.com/files/python/index.html Marc-Andre Lemburgs
site) I am not sure if this is correct but I can assure you I am looking
into it. This has been a frustrating problem but I will find the answer and
I appreciate all the help from everyone.

The error message returned is as follows (many depending on the situation, I
will state the situation)
    Type (Just using the DSN name):
            myconn = odbc.odbc('WEB')
    Error:
            Traceback (most recent call last): File
"c:\inetpub\scripts\misval.py", line 151, in ? myconn = odbc.odbc('WEB')
dbi.operation-error: [Microsoft][ODBC Microsoft Access Driver]General error
Not enough information to connect to this DSN with SQLConnect. Use
SQLDriverConnect. in LOGIN

    Type(DSN;UID;PWD):
          ('DSN=test;UID=Admin;PWD=admin')
    Error:
            Traceback (most recent call last): File
"c:\inetpub\scripts\misval.py", line 151, in ? myconn =
odbc.odbc('DSN=test;UID=Admin;PWD=admin') dbi.operation-error:
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified in LOGIN

    Type(DSN;UID;PWD):
            ('test;UID=Admin;PWD=admin')
    Error
        Traceback (most recent call last): File
"c:\inetpub\scripts\misval.py", line 151, in ? myconn =
odbc.odbc('test;UID=Admin;PWD=admin') dbi.operation-error: [Microsoft][ODBC
Driver Manager] Data source name not found and no default driver specified
in LOGIN

    Type(DSN/UID/PWD)Just tried this due to different strings I viewed on
the web.
            ('test/admin/admin')
    Error
    Traceback (most recent call last): File "c:\inetpub\scripts\misval.py",
line 151, in ? myconn = odbc.odbc('test/UID=Admin/PWD=admin')
dbi.operation-error:[Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified in LOGIN

I would appreciate any help.....

Jeremie Legault
jerlegault at hotmail.com
"Alejandro Lopez-Valencia" <dradul at mailandnews.com> wrote in message
news:asvdjd$v6mgh$1 at ID-99513.news.dfncis.de...
> On Sat, 7 Dec 2002 22:42:52 -0500, "Jeremie" <jivesojer at hotmail.com>
> wrote:
>
> >I have tried something similiar but it didn't work.Henrik mentioned that
I
> >had to show add a line that pointed to the SYSTEM.MDW file (Microsoft
Access
> >Security File). But I think the ODBC driver should handle that I mean
that
> >is the whole purpose I thought. I am going to try the way you formatted
it.
> >Thanks for the suggestion.
> >Jeremie
>
> The problems you have are strange and could be explained if you are
> trying to access an user DSN under a multiuser system such as Win2k or
> XP (NT 5.1). If such is the case, delete the present DSN and create it
> again as a system DSN (you need to be logged in as Administrator or as
> a user in the Administrators group, the default in Win2K Pro, not sure
> about XP).
>
> BTW, when you create an ODBC DSN to a Jet/ISAM database (Access
> database) with the administration control panel (under any version of
> MS Windows), initially there is no access rights database assigned to
> it and the system assumes that the user is Admin, with an empty
> password. This usually works because Access creates all elements in a
> database as owned by the Admin user by default. You have to assign
> ownership to other users explicitly (after adding them to system.mdw
> or a private security database).
>





More information about the Python-list mailing list