Connecting to SQL-Server

Robert Brewer fumanchu at amor.org
Thu Oct 7 16:28:02 EDT 2004


Greg Lindstrom wrote:
> I'm running Python 2.3 on a Windows XP box and am trying to 
> get connected to
> an MS SQL-Server.  I have found (seemingly) conflicting 
> methods to connect
> using the odbc module in the win32-all extensions.  I have 
> seen both of the
> following:
> 
> db = odbc.odbc('DSN/UID/PASSWORD)
> and
> db=odbc.odbc('DSN=dsn;UID=uid;PWD=password)
> 
> I can connect when I use my computer, but when I transfer the 
> code to a
> production box I am greeted with an error that the login is 
> not associated
> with a trusted connection.  So which, if either, of the above 
> methods should
> I use and what is the error about a trusted connection trying 
> to tell me?

I use "DSN=RE7_1;UID=mcontrol;PWD=*****;DSN=RE7_1;" Yes, the DSN is
listed twice. Don't ask me why this works; it just does. ;) I've found
that somehow, the first k/v pair gets discarded from these connection
strings.


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org



More information about the Python-list mailing list