title: Accessing Microsoft SQL Server from Windows in PERL
body: <p>I am using SQL Server driver. But this is the following error I get:</p>
  
  <pre><code>DBI connect('Driver={SQL Server}:$database:$host','cartertest',...) failed:
  [Microsoft][ODBC Driver Manager] Invalid connection string attribute (SQL-01S00)
  at PERL_SQL_Connect.pl line 15
  Can't call method "disconnect" on an undefined value at PERL_SQL_Connect.pl line 16
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>use DBI;
  use DBD::ODBC;
  #my $dsn = "dbi:SQL Server:$database:$host";
  my $dsn = 'DBI:ODBC:Driver={SQL Server}:$database:$host';
  
  my $host = 'amber';    ##This is the server name
  my $database = 'assignmentdb';     ##This is the database name
  my $user = 'something';         ## Database User Name
  my $auth = "something";
  
  #my $dsn = "dbi:SQL Server:$database:$host";
  
  $dbiconnect = DBI-&gt;connect($dsn,$user,$auth);   #line 15
  $dbiconnect-&gt;disconnect();                      #line 16
  </code></pre>
  
  <p>What mistake(s) am I making? </p>