![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I am using the following codes to initiate a Sybase connection. $dbh = new Sybase: Blib ($userid,$password,$server)if (!$dbh) { print 'Connection failed'; exit(0); } What can I do if I want to identify what error has occured? Is that caused by wrong server / wrong userid / wrong password? Please help. Thanks a lot for your advice. |
#3
| |||
| |||
|
|
I am using the following codes to initiate a Sybase connection. $dbh = new Sybase: Blib ($userid,$password,$server)if (!$dbh) { print 'Connection failed'; exit(0); } What can I do if I want to identify what error has occured? |
#4
| |||
| |||
|
|
ssss (AT) hutchcity (DOT) com (Green Dolphin) writes: I am using the following codes to initiate a Sybase connection. $dbh = new Sybase: Blib ($userid,$password,$server)if (!$dbh) { print 'Connection failed'; exit(0); } What can I do if I want to identify what error has occured? |
|
_ \___ _ _ ___// / -_) ' \/ -_) _|_\___|_||_\___| |
#5
| |||
| |||
|
|
Hello, You would need to install error and message handlers: $old_handler = dberrhandle($err_handle) $old_handler = dbmsghandle($msg_handle) Register an error (or message) handler for DB-Library to use. Handler examples can be found in sybutil.pl in the Sybperl distribution. Returns a reference to the previously defined handler (or undef if none were defined). Passing undef as the argument clears the handler. The DB-Library Reference Manual has details: http://sybooks.sybase.com/onlinebook...eric__BookView Green Dolphin wrote: Hi all, I am using the following codes to initiate a Sybase connection. $dbh = new Sybase: Blib ($userid,$password,$server)if (!$dbh) { print 'Connection failed'; exit(0); } What can I do if I want to identify what error has occured? Is that caused by wrong server / wrong userid / wrong password? Please help. Thanks a lot for your advice. |
#6
| |||
| |||
|
|
Thanks for your help. May I ask why error handler have to go with message handler? |
| Sybaseneal <user (AT) invalid (DOT) domain> wrote Hello, You would need to install error and message handlers: $old_handler = dberrhandle($err_handle) $old_handler = dbmsghandle($msg_handle) Register an error (or message) handler for DB-Library to use. Handler examples can be found in sybutil.pl in the Sybperl distribution. Returns a reference to the previously defined handler (or undef if none were defined). Passing undef as the argument clears the handler. The DB-Library Reference Manual has details: http://sybooks.sybase.com/onlinebook...eric__BookView Green Dolphin wrote: Hi all, I am using the following codes to initiate a Sybase connection. $dbh = new Sybase: Blib ($userid,$password,$server)if (!$dbh) { print 'Connection failed'; exit(0); } What can I do if I want to identify what error has occured? Is that caused by wrong server / wrong userid / wrong password? Please help. Thanks a lot for your advice. |
![]() |
| Thread Tools | |
| Display Modes | |
| |