Reading AutoCommit and Lock values from an external text
file
As an alternative to setting the AutoCommit and Lock properties
in a PowerBuilder application script, you can use the PowerScript
ProfileString function to read the AutoCommit and Lock values from a
specified section of an external text file, such as an
application-specific initialization file.
To read AutoCommit and Lock values from an external text
file:
-
Open the application script in which you want to set
connection properties. -
Use the following PowerScript syntax to specify the
ProfileString function with the SQLCA.Lock property:1SQLCA.Lock = ProfileString ( file, section, key, default )The AutoCommit property is a boolean, so you need to convert
the string returned by ProfileString to a boolean. For example,
the following statements in a PowerBuilder script read the
AutoCommit and Lock values from the [Database] section of the
APP.INI file:12345678string ls_stringls_string=Upper(ProfileString("APP.INI", "Database", "Autocommit",""))if ls_string = "TRUE" thenSQLCA.Autocommit = TRUEelseSQLCA.Autocommit = FALSEend ifSQLCA.Lock=ProfileString("APP.INI", "Database", "Lock","") -
Compile the script to save your changes.