Export (0) Print
Expand All

Debugging ActiveX Scripts

SQL Server 2000

If you have Microsoft® Windows® 2000, Microsoft Visual InterDev® 6.0 or the Microsoft Windows NT® 4.0 Option Pack installed, you can use the script debugger supplied with those products to troubleshoot your Microsoft ActiveX® scripts. Three types of events cause errors:

  • A forced break in the script execution.

  • Incorrect script syntax or object.

  • Objects that contain incorrect references.

Your ability to debug these errors depends on whether or not you have selected the Turn on just-in-time debugging check box.

To select the Turn on just-in-time debugging option

Enterprise Manager

Important  If you select the Turn on just-in-time debugging check box, save your script or Data Transformation Services (DTS) package prior to running it or you will lose your changes. When you close the debugger window, the script and the launching application are also closed.

Forcing the execution to break using code

To force the script code to stop, insert a STOP statement into your Microsoft Visual Basic® Scripting Edition (VBScript), or a Debugger statement into your Microsoft JScript® code.

  • If the Turn on just-in-time debugging check box is not selected, then the script will show no indication of an error and will return a successful completion.

  • If the Turn on just-in-time debugging check box is selected, an unhandled run-time error will occur and you will be given the option to debug. At this point:
    • If you click No, the response will be the same as if the debug option was not selected: the script will show no other indication of the error and will return a successful completion.

    • If you click Yes, a debugging window will open and you can use the debugger to step through the code.
Script syntax or object required errors

Scripting errors, such as a syntax error or "Object required" errors, can also occur:

  • If the Turn on just-in-time debugging check box is not selected, then the script will report that an error occurred in the status column of the Executing DTS Package dialog box. By double-clicking the failed step, you can see the error source, description, and the line number in the code causing the error.

  • If the Turn on just-in-time debugging check box is selected, the debugging environment opens immediately upon hitting the error.
Execution suspends due to an error raised from an object

These are errors raised by objects such as an Microsoft ActiveX Data Object (ADO) object. For example, the ADO object calls a nonexistent property on a COM object. An error of this type opens up the debugger using the same method as when execution is suspended because of a script error or object required error. Unlike script or object required errors, error information from the object itself is displayed.

Show:
© 2014 Microsoft