Dear Monks,

The following code produces the following report. Any explanations?

#! perl -w scipt use strict; use DBI; use DBD::ODBC; my ( $data_source, $database, $user_id, $password ) = qw( matt First_t +rial matt gold ); my $conn_string = "driver={SQL Server};Server=$data_source;Database=$d +atabase;UID=$user_id;PWD=$password"; my $dbh = DBI->connect( "DBI:ODBC:$conn_string" ) or die $DBI::errstr; my $sql = "SELECT * FROM Doncaster_1975_onwards LIMIT 100"; my $sth = $dbh->prepare( $sql ); $sth->execute; my $out = "out_connection.txt"; open (OUT, "$out"); while ( my $result = $sth->fetchrow_hashref ) { # Your fields can be accessed through the $result hashref, for exa +mple: print OUT "$result\n"; } $dbh->disconnect; C:\Documents and Settings\MattR\2003\Perl\November\5_12_04>perl Data_A +.pl DBI connect('driver={SQL Server};Server=matt;Database=First_trial;UID= +matt ;PWD=gold','',...) failed: [Microsoft][ODBC SQL Server Driver][Named P +ipes]S pecified SQL server not found. (SQL-08001) [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen (Create +File()). ( SQL-01000)(DBD: db_login/SQLConnect err=-1) at Data_A.pl line 15 [Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL server n +ot found. (SQL-08001) [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen (Create +File()). ( SQL-01000)(DBD: db_login/SQLConnect err=-1) at Data_A.pl line 15.

In reply to Access to MS Server by Win

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.