PvSecureDatabase2()
Enables database security for an existing database. It differs from PvSecureDatabase() in that it supports domain authentication.
Header File: dtisecurity.h (See also
Header Files)
Function First Available In Library: w3dbav90.dll (Windows), libpsqldti.so (Linux), libpsqldti.dylib (macOS) (See also
Link Libraries)
Syntax
BTI_API PvSecureDatabase(
BTI_LONG hConnection,
BTI_CHAR_PTR dbName,
BTI_CHAR_PTR dbPassword,
BTI_LONG dbAuthentication);
Arguments
In | hConnection | Connection handle that identifies the server. Connection handles are obtained with the PvConnectServer() function. |
In | dbName | Name of the database. |
In | dbPassword | Database password for Master user. |
In | dbAuthentication | Type of authentication to enable. Values are 1 for database and 2 for domain. |
Return Values
P_OK | The operation was successful. |
P_E_INVALID_HANDLE | Invalid connection handle. |
P_E_NULL_PTR | Call with NULL pointer. |
P_E_ACCESS_RIGHT | Insufficient access right for the operation. |
P_E_FAIL | Failed to open the database for other reasons. |
PCM_errSessionSecurityError | Invalid password. |
Remarks
The following preconditions must be met:
•Connection established by
PvConnectServer() or if you are performing the operation on a local machine, P_LOCAL_DB_CONNECTION may be used as the connection handle.
•When you enable security, you must choose a password for the Master user. Security for the database is enforced based on the access rights defined for the database and should match behavior seen in SQL or ODBC access methods.
•You must be connecting to a Windows server. Calls to Linux or macOS servers return a general failure (status code 7004), since Active Directory domain authentication is Windows only.
See Also