Reading DBParm values from an external text file
As an alternative to setting the DBParm property in a
PowerBuilder application script, you can use the PowerScript
ProfileString function to read DBParm values from a specified section
of an external text file, such as an application-specific
initialization file.
To read DBParm values from an external text file:
-
Open the application script in which you want to specify
connection parameters.For instructions, see the section called “Opening Script views” in Users Guide.
-
Use the following PowerScript syntax to specify the
ProfileString function with the SQLCA.DBParm property:1SQLCA.dbParm = ProfileString ( file, section, key, default )For example, the following statement in a
PowerBuilder script reads the DBParm values from the [Database]
section of the APP.INI file:1SQLCA.dbParm=ProfileString("APP.INI", "Database", "dbParm","") -
Compile the script to save your changes.
For instructions, see the section called “Compiling the script” in Users Guide.