Error handling in Data Access Page

  • Thread starter Thread starter Beeawwb
  • Start date Start date
B

Beeawwb

Hi all,

Not sure if this is the right place for it, but it's a start.

I've been sent some data access pages, which have all been configured in the
Microsoft Script Editor. Everything works fine, there's no real problems, but
I'm looking at making some changes to the script and I've run into my first
problem.

vbScript, at least as far as the script editor goes, does not handle errors
like VBA would. If I try "On Error Goto ErrHandle", it gives an error. In
fact, only "On Error Resume Next" has worked for me.

Does anybody know the proper way to impliment error handling into these data
access pages (vbScript) so that I can trap for specific errors?

Thanks for your time and assistance,

-Bob
 
There is no way to trap errors in a Data Access Page. It's one of the
reasons that DAPs have not been very useful, and Microsoft has deprecated
them in ACCESS 2007.

If your desire is to trap for errors while debugging the script, the only
method I've found is to put a "MsgBox" action after every step of the script
so that you can track the progress of the DAP through the script. When the
MsgBox doesn't appear, there was an error on the previous script step, and
then you can investigate why an error occurred. Caution: this is a tedious,
frustrating process.
 
Hi Ken,

Well if there's no way to do it, then that's that! Thanks for your response,
at least I won't be losing any time working on it.

We were actually looking at trapping an error whereby an object wasn't open,
so we could open it as required. Only way we can determine if the object is
open is by the error invoked when it's not. All good.

Thanks again.
-Bob
 
Back
Top