[DB-SIG] DSNless connections (w/ mxODBC or others)
Greg Brunet
gbrunet at sempersoft.com
Sun Aug 17 21:07:33 EDT 2003
I DL'd Marc-Andre Lemburg's mxODBC package to test out connecting to my
SQL Server (actually MSDE) databases. He gives an example of connecting
to a database like this:
>>> import mx.ODBC.Windows
>>> db = mx.ODBC.iODBC.DriverConnect('DSN=database;UID=user;PWD=passwd')
When coding in the MS world (using ADO & DO.NET), I've moved to DSN-less
connection strings. One might look something like this:
'Provider=SQLOLEDB;Data Source=(local);Initial Catalog=myDB;User
ID=myuser;Password=mypwd'
Is it possible to have DSN-less connections using mxODBC (specifically
on a Windows client & Windows server)? I'd like to be able to access a
database without setting up a DSN first! Thanks,
--
Greg
More information about the DB-SIG
mailing list