This is my second attempt to try and get some insight into how to do
this. The DBD::ODBC::ping method calls DBI::_new_sth to obtain a new
statement handle but DBD::ODBC prevents creating a new statement handle
when not connected (you cannot actually get one even if you wanted). The
problem is once DBD::ODBC discovers we are not connected it does:
DBIh_SET_ERR_CHAR(
h, imp_xxh, Nullch, 1,
"Cannot allocate statement when disconnected from the database",
"08003", Nullch);
and because PrintError is on the error is output and because RaiseError
is on the error handler is called. Most people are calling ping when not
connected and do not want this error and I wanted to mask it by
temporarily disabling PrintError and RaiseError but it does not seem to
work for me.
Initially I tried using local $dbh->{PrintError} = 0 but this did not
work. Then I remembered I needed to call STORE from inside the driver so
changed to $dbh->STORE('PrintError', 0); but that does not work either.
Any ideas how to disable PrintError/RaiseError from inside DBD::ODBC::ping?
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com