Up Prev Next
From: "Sabherwal, Balvinder (MBS)"
<Balvinder dot Sabherwal at mortgagefamily dot com>
Subject: Handling Errors
Date: Feb 8 2002 1:20PM
I have a perl script and I am trying to trap the errors at the time of
establishing the connection to the server. The code I use to this is below,
however this it not woring as I don't get the error message printed.
$dbhndl = Sybase::CTlib->ct_connect($usr, $pswd, $Srv); ## Connect to the
if($dbhndl eq "CS_FAIL")
Connection to server failed.
This could be due to an invalid Login Name,Password,Server.
If you feel all of these are correct, then pls check of the server is
running and your login is not locked.
Still if you can't connect, Pls check you interfaces of sql.ini files.
Can some one help me in getting this work. I executed the script in the
debug mode and the output for the error is as below
main::(isqlt.cgi:42): $dbhndl = Sybase::CTlib->ct_connect($usr, $pswd,
$Srv); ## Connect to the server.
Message number: 4002, Severity 14, State 1, Line 1
Message String: Login failed.
Open Client Message:
Message number: LAYER = (4) ORIGIN = (1) SEVERITY = (4) NUMBER = (44)
Message String: ct_connect(): protocol specific layer: external error: The
attempt to connect to the server failed.
main::(isqlt.cgi:44): if($dbhndl eq "CS_FAIL")
DB<1> p $dbhndl
How can I print the error msg returned from the server along with the error
msg I am trying to print??