Coding PowerScript to set a value for the DBMS property

Another way to start the Database Trace tool in a PowerBuilder script is to specify it as part of the DBMS property of the Transaction object. The Transaction object is a special nonvisual object that PowerBuilder uses to communicate with the database. The default Transaction object is named SQLCA, which stands for SQL Communications Area.

SQLCA has 15 properties, 10 of which are used to connect to your database. One of the 10 connection properties is DBMS. The DBMS property contains the name of the database to which you want to connect.

StepsTo start the Database Trace tool by specifying the DBMS property:

  1. Use the following PowerScript syntax to specify the DBMS property. (This syntax assumes you are using the default Transaction object SQLCA, but you can also define your own Transaction object.)

    SQLCA.DBMS = "trace DBMS_name"
    

    For example, the following statements in a PowerBuilder script set the SQLCA properties required to connect to an Adaptive Server database named Test. The keyword trace in the DBMS property indicates that you want to trace the database connection.

    SQLCA.DBMS         = "trace SYC"
    
    SQLCA.database     = "Test"
    
    SQLCA.logId        = "Frans"
    
    SQLCA.LogPass      = "xxyyzz"
    
    SQLCA.ServerName   = "Tomlin"