well, if your database requires a username/password, then you can't just pass it the path (DSN). Not even sure how you expect anyone to do that. I believe certain ODBC clients might have the capability to embed that either inside the DSN and/or somewhere else on the system, so that when a certain DSN is recognized, that username/password is used, but not sure what clients and/or version do that.
Thanks. Ilya > -----Original Message----- > From: News Reader [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 10, 2004 1:36 PM > To: [EMAIL PROTECTED] > Subject: Avoiding coding username/password directly into perl script > > > Hi there, > > I figured this would be a pretty common problem, but I didn't see > anything in the FAQ or docs. > > We've got a script that uses DBI to connect to SQL Server. > > There is a system DSN set up and this already has the username and > password. So do we really need to pass them again, as shown below? > > my $db = DBI->connect("dbi:ODBC:$dsn","$db_user_name","$db_password"); > > We tried the following (removing the username/password parameters), > but we got a connection error. > > my $db = DBI->connect("dbi:ODBC:$dsn"); > > It would be nice (for maintenance) and obviously more secure if we > could pass only the DSN name. > > Thanks, > - ML >