Error Handling for Workflow Script

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

If any error occurs in the workflow script, by default, the entire transaction is rolled back. If you want to override the default behavior, you must add script that traps, evaluates, and clears the error, so the change is committed despite the errors.

When the error is cleared, your script can return information to the client to inform users of possible errors. You can create your own error message table that the client can use to populate message boxes or status lines.

In a custom user interface, you can control and modify error messages, including errors from workflow execution. To do this, you must use ADO to make it possible for your client applications to access and manipulate data from a database server through an OLE DB provider. After you execute a database update in ADO, the Connection object holds the errors returned by this operation in the Errors collection.

ADO supports key features for building client/server and Web-based applications. Its primary benefits are ease of use, high speed, low memory overhead, and a small disk footprint. ADO also features Remote Data Service (RDS), by which you can move data from a server to a client application or Web page, manipulate the data on the client, and return updates to the server in a single round trip.

To learn more about ADO, see the ADO Overview in Microsoft® Access documentation.

For information about using the Logger object to log errors, see the Logger Object Model Reference.

See Also

Scripting Workflow Events for SQL Server | Scripting Events in the Workflow Designer for SQL Server | When to Use Which Event | Data Manipulation Using Workflow Script | Testing and Debugging in the Workflow Designer for SQL Server | Script Examples for SQL Server