Page 1 of 1

DB Error "hook" (Solved)

PostPosted: Tue Nov 26, 2013 1:02 pm
by ebear
Hello All,

Is there a possibility to have a publication "global hook" for DB errors??? By this I mean; when a DB Error comes up GoSub .....
I know that there would be a possibility to do this with a Timer, but when the check is needed say every second this would slow the app down.
Also it would be possible to check before every DB action but this makes the pub more complicated.

Or maybe ... something like GoSub if [dbpError] or any specified variable changes....

Thanks for your reactions,

Eric Beerhorst

Re: DB Error "hook"

PostPosted: Tue Nov 26, 2013 4:06 pm
by Gaev
Eric:

If you are refering to the Pro version of NeoBook's database plugin ... NeoBookDBpro ... take a look at the Help file info for dbpShowErrors ... where it says ...
Note: In addition to the normal error trapping provided by the [dbpError] variable, you can also create an error subroutine called DBPro_OnError to execute special actions whenever a database error occurs. For example, the following subroutine beeps annoyingly whenever a database error is detected:

: DBPro_OnError
PlayTone "440"
Return
... but you would still have to store some kind of information about each of the database commands (in another variable) ... before you invoke each command ... so you could tell (within this subroutine) what the offending command was.

Re: DB Error "hook"

PostPosted: Tue Nov 26, 2013 4:20 pm
by ebear
Gaev,

Your complete right, this is something I over saw in the manual :oops: . The difference in the several procedures is to do with a simple "if else endif".

Thanks a lot for your reaction.

Eric