To connect to the database based on the user credentials provided at runtime (instead of using the user name and password in the cache), you can select the "Allow dynamic connection using the transaction LogID and LogPass" option when creating the cache (or set the "DynamicConnection" parameter to True in the PowerServer cache), so that the application will use the LogID and LogPass property values of the Transaction object (or the UID and PWD values in the ConnectString DBParm parameter) to log in to the database server.
When connecting to the database through the ODBC driver, the application uses the UID and PWD values in the ConnectString DBParm parameter to log in to the database; when connecting to the database through a direct connection, the application uses its LogID and LogPass property values to log in to the database; as shown in the following table. "Direct connection" means connecting with the database using the information provided by the client app (instead of using cache). The connection information is sent from the client app to the PowerServer Web APIs when PowerServer connects with the database. See the next section ("Using Transaction object properties") for more information.
DB type | Connection type | User credentials used for connection |
---|---|---|
SQL Anywhere ASE DB2 Informix MySQL Oracle PostgreSQL SQL Server |
ODBC connection |
UID and PWD in the ConnectString DBParm parameter For example, SQLCA.DBParm = "ConnectString='DSN=PB Demo DB V2025;UID=dba;PWD=sql',driver='SqlAnywhere'" |
Informix Oracle SQL Server |
Direct connection |
LogID and LogPass of Transaction object For example, SQLCA.LogId = "sa" SQLCA.LogPass = "Appeontest" |