Danilov Dmitry wrote:
> 
> ...
> #!/usr/bin/perl
> use DBI;
> my $dbh = DBI->connect
> ("dbi:Sybase:mssql", 'test', 'test');
> die "Unable for connect to server $DBI::errstr"
>     unless $dbh;
> my $rc;
> my $sth;
> $sth = $dbh->prepare("select * from test");
> if($sth->execute) {
>     while(@dat = $sth->fetchrow) {
>                 print "@dat\n";
>     }
> }
> 
> DBI->connect(mssql) failed: OpenClient message: LAYER
> = (1) ORIGIN = (2) SEVERITY = (6) NUMBER = (151)
> Message String: ct_connect(): user api layer: internal
> Client Library error: A connection to the server must
> exist on the
> connection structure before this routine can be called.
> at ./test.pl line 5
> Unable for connect to server OpenClient message: LAYER
> = (1) ORIGIN = (2) SEVERITY = (6) NUMBER = (151)
> Message String: ct_connect(): user api layer: internal
> Client Library error: A connection to the server must
> exist on the
> connection structure before this routine can be called.
> 
The error message claims about line Nr. 5.
Couriously it's the die command.

The only imaginary solution can be, 
that $DBI::errstr cannot be called if there is no database.
I believe, it would be the last error message USING the database.
But the error could be, that you get no connection to.

You should better try:
my $dbh = DBI->connect("...",...,...) or die "Unable for connect to
server";

Best Wishes,
Andrea

PS: I'm not sure anyway :-((

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to