Microsoft Access Database connecting from Python through ODBC
Alejandro Lopez-Valencia
dradul at mailandnews.com
Tue Dec 10 06:59:41 EST 2002
On Mon, 9 Dec 2002 13:24:59 -0500, "Jeremie" <jivesojer at hotmail.com>
wrote:
>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.....
Hi Jeremy,
I think I've got it in the case you are using some flavor of Windows
NT; if under Win9x, I wouldn't know. You need to set up process
ownership permissions for the web server service.
In order to run a system service under NT you need to assign the
effective UID to either SYSTEM or to give the effective owner the
permission to start sessions as a service. To set it up you need to go
into Control Panels/Administrative Tools/Local Security Directives and
in the MMC console open the tree Local Directives/User rights
assignment and add the effective user to the entry "Open session as a
service", probably you need the user batch execution rights as well.
Mind you, I am translating all the names to English from my Latin
American Win2K OS, so the actual names will surely be different, but
you get my drift. :)
More information about the Python-list
mailing list