title: Perl ODBC connection without password
body: <p>I want my Perl script to use ODBC connection string to connect to DB. This works fine with code below. But I also want it to use username+password that I have entered into the ODBC connection. I don't want to supply these from within the script.</p>
  
  <p>Anyone know how to achieve this?</p>
  
  <pre><code>use DBI;
  
  my $strConn = "dbi:ODBC:MyDB";
  my $username = "username";
  my $password = "password";
  
  # Does work
  $dbh = DBI->connect( $strConn, $username, $password, { PrintError => 1, RaiseError => 1 } );
  
  # Does not work
  #$dbh = DBI->connect( $strConn, undef, undef, { PrintError => 1, RaiseError => 1 } );
  
  if ($dbh)
  {
     print "OK\n";
  } else {
     print "FAIL\n";
  }
  </code></pre>
  
  <p>Note: DB must have password set (blanking pwd not an option).</p>
  
  <p>Operating system is Windows 2008 R2 (64-bit). The ODBC connection is defined in System DSN as 32-bit. Perl-version is 32-bit. Connection is done to MSSQL 2008 R2.</p>