in reply to dbd::ODBC command strings

from the DBD::ODBC docs right, in the line right above the 'Random Links' section:

my $DSN = 'driver={SQL Server};Server=server_name;database=database_na +me;uid=user;pwd=password;'; my $dbh = DBI->connect("dbi:ODBC:$DSN") or die $DBI::errstr\n";

Hope that helps,
etm117

UPDATE: If I recall correctly, the server_name needs to be the name of your ODBC connection defined on the machine you are running the code.

Replies are listed 'Best First'.
Re^2: dbd::ODBC command strings
by s_m_b (Acolyte) on Sep 16, 2005 at 13:47 UTC
    found it -
    my $dbh = DBI->connect('DBI:ODBC:'.$dbname, $dblogin, $dbpass)

    was
    my $dbh = DBI->connect('DBI:ODBC:$dbname', $dblogin, $dbpass)

    forgotten to concatenate the dbi string !