pb 大局 判断 数据库 是否连接成功

pb 全局 判断 数据库 是否连接成功
我现在有好多窗口里面有select 语句 using sqlca,当数据库处于不可用状态时候,怎么去做全局判断?不可能每个select都去判断一下。

------解决方案--------------------
这个没有啥好办法。
只是可以从改善网络状况,搭建VPN 等,使系统更稳定,事务连接更可靠而已。
------解决方案--------------------
pb11.5以后可以,
继承transaction,在DBError事件里面写上连接判断与恢复的语句,
再将SQLCA的父类设置为你定义的新类

Argument Description
code Long by value. A database-specific error code. See your DBMS documentation for information on the meaning of the code.When there is no error code from the DBMS, code contains one of these values:-1 - Cannot connect to the database-2 - Writing a blob to the database failed-4 - All other errors (see Usage note for more detail)
sqlerrortext String by value. A database-specific error message.
sqlsyntax String by value. The full text of the SQL statement being sent to the DBMS when the error occurred.