Starting the Database Trace tool

By default, the Database Trace tool is turned off in PocketBuilder. You can start it by editing a database profile or a script.

NoteTurning tracing on and off To turn tracing on or off, you must reconnect. Setting and resetting are not sufficient.

Running Database Trace when you test your application

In the script where you set the values of SQLCA parameters, add the word TRACE to the value for the DBMS parameter. For example, if you are using the default transaction object, type:

SQLCA.DBMS = "TRACE ODB"

As an alternative to setting the DBMS property directly in an application script, you can use the PowerScript ProfileString function to read values from a specified section of an external text file, such as an application-specific initialization file.

Use the following PowerScript syntax to specify the ProfileString function with the DBMS property:

SQLCA.variable = ProfileString(file, section, variable, default_value)

For example, the following statement in a PocketBuilder script reads the DBMS value from the [Database] section of the APP.INI file:

SQLCA.dbms =
   ProfileString("APP.INI","Database","DBMS","")

Running Database Trace when you work in painters

To trace connection activity when you work in the DataWindow and Database painters, you set a property in the connection profile you are using.

StepsTo start the Database Trace tool by editing a profile:

  1. Open the Database Profile Setup dialog box for the connection you want to trace.

  2. On the Connection tab, select the Generate Trace check box and click OK or Apply.

    On the Preview tab, the setting that starts Database Trace is DBMS:

    SQLCA.DBMS = "TRACE ODB"
    
  3. Click Connect in the Database Profiles dialog box to connect to the database.

    A message box displays, stating that database tracing is enabled and indicating where PocketBuilder will write the output.

  4. Click OK.

    PocketBuilder connects to the database and starts tracing the connection.