>
Easiest route is to set up a system DSN via the ODBC administrator and then just specify the DSN name in the connection string.
Alternatively, use a DSN-less connection string:
my $dsn = "driver=Adaptive Server Anywhere 8.0;DBN=database;ENG=server;LINKS=tcpip{host=192.168.0.99}";
my $dbh = DBI->connect("dbi:$dbd:$dsn", $uid, $pwd, $attr) or die "Error: Connecting to datasource: $DBI::errstr";
However, on testing with Perl 5.8, DBI 1.30 / DBD::ODBC 0.43 I notice that I get an unexpected error:
failed: [Sybase][ODBC Driver][Adaptive Server Anywhere]General error: Connection was terminated (SQL-S1000)(DBD: dbd_db_login/SQLSetConnectOption err=-1)
A quick look in the ODBC SQL trace file indeictes the following problem:
perl -w 500-4ec EXIT SQLSetConnectOption with return code -1 (SQL_ERROR)
HDBC 01D515E8
SQLINTEGER 102 <SQL_AUTOCOMMIT>
SQLPOINTER 0x00000001
DIAG [S1000] [Sybase][ODBC Driver][Adaptive Server Anywhere]General error: Connection was terminated (-308)
But this error does not occur when using a DSN name rather than a DSN-less connection or when using DBD::ADO.
-- Simon Oliver