To use the login credentials provided at runtime to log in to the database server (instead of using the values in the User name and Password fields of the cache), you can create a cache and then select the "Allow dynamic connection using the transaction LogID and LogPass" option (or set the "DynamicConnection" parameter to True in the PowerServer cache), so that the application will either 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 V2022R2;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 = "Appeon123!@#" |