OpenConnection
Uses a data source name or connection string to open a connection to a Lookup database.
Syntax
bool OpenConnection (strParam)Parameters
The Database Connection String, using an OLEDB or ODBC database provider.If the action is establishing a connection with DB2, Oracle database, or SQL Server database, you must specify the user ID and Password. Some database providers support integrated authentication, which use the credentials of the running process.
Smart parameters are supported and recommended to prevent plain text credentials in the application rules.
Returns
True if the action results in a connection to the database. Otherwise, False.Level
All.Details
This action uses the Connection String that you provide as the parameter to open a connection to your LookUp database.- Example:
OpenConnection("@APPVAR(*/fingerprintconn:cs)")This example opens the fingerprint database and obtains the connection information from the Application Service. It is recommended to use the application service so passwords are kept hidden.
Access: OpenConnection("Provider=MSACCESS;DSN=C:\Datacap\1040EZ\1040ezLook.mdb;UID=;PWD=;") Oracle: OpenConnection("Provider=OraOLEDB.Oracle.1;Password=mypassword;Persist Security Info=True;User ID=myuserid;Data Source=TM2") SQL Server (Standard authentication): OpenConnection("Provider=SQLOLEDB;Data Source=SQLServerName;Initial Catalog=myDatabase;User ID=myUserid;Password=myPassword;") SQL Server (Integrated authentication): OpenConnection("Provider=SQLOLEDB;Data Source=SQLServerName;Initial Catalog=myDatabase;Integrated Security=SSPI;") DB2: OpenConnection("Provider=IBMDADB2;Hostname=1.22.333.444;Port=50000;Data Source=DB2;Database=myDatabase;User ID=myUserid;Password=myPassword;")Access: OpenConnection("Provider=MSACCESS;DSN=C:\Datacap\1040EZ\1040ezLook.mdb; UID=;PWD=;") Oracle: OpenConnection("Provider=OraOLEDB.Oracle.1;Password=mypassword; Persist Security Info=True;User ID=myuserid;Data Source=TM2") SQL Server (Standard authentication): OpenConnection("Provider=SQLOLEDB;Data Source=SQLServerName;Initial Catalog=myDatabase;User ID=myUserid;Password=myPassword;") SQL Server (Integrated authentication): OpenConnection("Provider=SQLOLEDB;Data Source=SQLServerName;Initial Catalog=myDatabase;Integrated Security=SSPI;") DB2: OpenConnection("Provider=IBMDADB2;Hostname=1.22.333.444;Port=50000;Data Source=DB2;Database=myDatabase;User ID=myUserid;Password=myPassword;")