Microsoft Access Database connecting from Python through ODBC

Tim Roberts timr at probo.com
Sun Dec 8 23:05:13 EST 2002


"Jeremie Legault" <jlegault at impathnetworks.com> wrote:

>I wonder if anyone knows how to format the login string to connect to a
>Microsoft Access Database through ODBC. If I open a shell and test my code
>it connects without needing a user ID and password. However if I connect
>through a CGI script (python is invoked by the CGI request) I can not
>connect to the database. I tried adding the
>'DSN=OwnDatabase;UID=Mikkon;PWD=abcde' but this returns errors. I believe it
>works when I invoke the program because I am logged in with an account that
>has valid permission to interact with the database.

You've recived some good responses to this, but I would like to veer off to
the side a bit.

To me, there doesn't seem to be much of a pattern to the DSN strings used
with ODBC connections.  It almost seems like every provider uses a
different syntax.  If anyone knows of a web site that summarizes the ODBC
connection string syntaxes (syntices?) for various ODBC providers, I would
appreciate a pointer.
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list