About Transaction objects

In a PowerBuilder database connection, a Transaction object is a special nonvisual object that functions as the communications area between a PowerBuilder application and the database. The Transaction object specifies the parameters that PowerBuilder uses to connect to a database. You must establish the Transaction object before you can access the database from your application, as shown in Figure 12-1:

Figure 12-1: Transaction object to access database

Within the PowerBuilder application is a transaction object . It connects to the database or DBMS using connection parameters. The database sends status information back to the transaction object.

Communicating with the database

In order for a PowerBuilder application to display and manipulate data, the application must communicate with the database in which the data resides.

StepsTo communicate with the database from your PowerBuilder application:

  1. Assign the appropriate values to the Transaction object.

  2. Connect to the database.

  3. Assign the Transaction object to the DataWindow control.

  4. Perform the database processing.

  5. Disconnect from the database.

For information about setting the Transaction object for a DataWindow control and using the DataWindow to retrieve and update data, see the DataWindow Programmers Guide.

Default Transaction object

When you start executing an application, PowerBuilder creates a global default Transaction object named SQLCA (SQL Communications Area). You can use this default Transaction object in your application or define additional Transaction objects if your application has multiple database connections.

Transaction object properties

Each Transaction object has 15 properties, of which: