skip to main content
Interface Provider class : IP methods reference : ipConnect
 

ipConnect

This method connects to the given logical database using the supplied user name and password. The IP can validate the user and password and generate a DAM_FAILURE if the user is not authorized to access the database. The IP can also set up data structures to enforce user rights to select, delete, insert and update tables. This method is called immediately after OpenAccess SDK has created this object.
int ipConnect(
int64 tmHandle,
int64 dam_hdbc,
string sDataSourceName,
string sUserName,
string sPassword,
string sCurrentCatalog,
string sIPProperties,
string IPCustomProperties)
 
Table 2: Parameters for ipConnect 
Parameter
Type
Description
IN
 
 
tmHandle
int64
A handle for use with the tm_trace() method.
dam_hdbc
int64
The OpenAccess SDK SQL Engine connection handle.
sDataSourceName
string
The name of the Data Source to which the connection is being made.
sUserName
string
User name passed in by the client.
sPassword
string
Password passed in by the client.
sCurrentCatalog
string
Name of the catalog to use. The value can be specified by the client or in the DataSourceCurrentCatalog attribute.
sIPProperties
string
Data source specific information that is set in the DataSourceIPProperties attribute.
sIPCustomProperties
string
Custom properties passed in by the client. The keywords that can appear in this string are based on the setting of the DataSourceIPCustomProperties attribute.
RETURN
 
 
 
int
DAM_SUCCESS – on success
DAM_FAILURE – on failure
NOTE: The default value is DAM_SUCCESS.
If no return value is specified, the OpenAccess SDK SQL Engine assumes that the return value is DAM_SUCCESS.
The IP does not generate a DAM_FAILURE unless specified.
The sUserName and sPassword are valid only if the data source property DataSourceLogonMethod is set to DBMSLogon(UID,PWD) or DBMSLogon(DBUID,DBPWD). Please refer to OpenAccess SDK Administrator’s Guide for information about what this method needs to do to support Microsoft Windows authentication (NTLM or Kerberos).
The connect string that the client uses to connect to your database can be accessed by using dam_getInfo with the option DAM_INFO_CONNECTION_STRING:
dam_getInfo(DAM_INFO_CONNECT_STRING)
The sIPCustomProperties string contains all the information that was supplied by the user, including any custom options your IP will support. The string contains all the options as semicolon separated values. Each value consists of the option name and its setting. This allows your IP to supports its own keywords for specifying connection level information.

See also 

dam_getInfo