Using a Transaction object

In a DataWindow database connection, a Transaction object is a nonvisual object that functions as the communications area between the DataWindow and the database. The Transaction object specifies the parameters that the DataWindow server uses to connect to a database. You must establish the Transaction object before you can access the database from your application.

Communicating with the database

If you are using a Transaction object, you take the following general steps:

  1. Create a Transaction object.

  2. Set its properties.

  3. Connect to the database.

  4. Assign the Transaction object to a DataWindowControl, WebDataWindowControl, or DataStore and perform database processing.

  5. Disconnect from the database.

NoteException handling The sample code in the following sections is simplified for brevity. You would usually wrap your code with try-catch statements to ensure that attempts to modify the database succeeded before committing the transaction. For more information, see “Exception handling”.