Making dynamic database connections from the app client

If there is no transaction-to-cache mapping configured for the app (either statically or dynamically, as explained in Setting up static database connection for the app runtime and Dynamically mapping transaction object with cache), you can make direct connections with the following databases from the application client.

Instead of storing the connection settings in the PowerServer solution, the connection info is stored at the client side, in the script, or in the application INI files. Saving sensitive information at the client is not recommended because of security concerns. Therefore, this approach is not recommended.

  • MS SQL Server (through Native Client, OLE DB, ADO.NET)

  • Oracle

  • SQL Anywhere (through ODBC)

  • Adaptive Server Enterprise (through ODBC)

MS SQL Server through Native Client:

SQLCA.DBMS = "SNC SQL Native Client(OLE DB)"
SQLCA.LogPass = "Appeon123!@#"
SQLCA.ServerName = "172.16.3.243"
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Database='qa_datawindow'"

MS SQL Server through OLE DB:

SQLCA.DBMS = "OLE DB"
SQLCA.LogPass = "Appeon123!@#"
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = "PROVIDER='SQLOLEDB',DATASOURCE='172.16.3.243',PROVIDERSTRING='database=qa_datawindow'"

MS SQL Server through ADO.NET:

SQLCA.DBMS = "ADO.Net"
SQLCA.LogPass = "Appeon123!@#"
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Namespace='System.Data.SqlClient',DataSource='172.16.3.243',Database='qa_datawindow'"

Oracle:

SQLCA.DBMS = "ORA Oracle"
SQLCA.LogPass = "appeon"
SQLCA.ServerName = "172.16.3.98/pdborcl" //servername must point to a remote instance; cannot be local.
SQLCA.LogId = "DBO"
SQLCA.AutoCommit = False
SQLCA.DBParm = "DisableBind=1"
SQLCA.DBParm = "TableCriteria='DBO',DisableBind=1"

SQL Anywhere through ODBC:

SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DSN=PB Demo DB V2021;UID=dba;PWD=sql',driver='SqlAnywhere'"

Adaptive Server Enterprise through ODBC:

SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DSN=en_ase1253;UID=en_ase1253;PWD=en_ase1253',driver='ase'"