If the user\pass is already in the DSN you should be able to just...

my $db = 
DBI->connect("dbi:ODBC:$dsn","","");


>-----Original Message-----
>From: Sterin, Ilya (I.) [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, March 10, 2004 12:43 PM
>To: [EMAIL PROTECTED]
>Subject: RE: Avoiding coding username/password directly into 
>perl script
>
>
>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
>> 
>


**********************************************************************
This email and any files transmitted with it are confidential
and intended solely for the individual or entity to 
whom they are addressed.  If you have received this email
in error destroy it immediately.
**********************************************************************
             Wal-Mart Stores, Inc. Confidential
**********************************************************************

Reply via email to