As an alternative to setting the DBMS property in your PowerBuilder application script, you can use the PowerScript ProfileString function to read the DBMS value from a specified section of an external text file, such as an application-specific initialization file, or from an application settings key in the registry.
The following procedure assumes that the DBMS value read from the database section in your initialization file uses the following syntax to enable database tracing:
DBMS = trace DBMS_name
To start the Database Trace tool by reading the
DBMS value from an external text file:
Use the following PowerScript syntax to specify the ProfileString function with the DBMS property:
SQLCA.DBMS = ProfileString(file, section, variable, default_value)
For example, the following statement in a PowerBuilder script reads the DBMS value from the [Database] section of the APP.INI file:
SQLCA.DBMS=ProfileString("APP.INI","Database", "DBMS","")
For how to get a value from a registry file instead, see “Getting values from the registry”.