The provider-specific property sets DBPROPSET_ADSDATASOURCEINFO and DBPROPSET_ADSSESSIONINFO can be accessed from ADO Connection objects once a connection to Advantage has occurred. For details and valid values for each property, see Provider-Specific Data Source Information Properties and Provider-Specific Session Properties. The following is the mapping between the "friendly" property name and the property ID.
Property ID |
Property Name |
ADSPROP_CONNECTION_HANDLE |
ACE Connection Handle |
ADSPROP_ENFORCE_AUTOINC |
Enforce AutoInc |
ADSPROP_ENFORCE_UNIQUE_INDEX |
Enforce Unique Index |
ADSPROP_ENFORCE_RI |
Enforce RI |
After a connection has been made to the Advantage OLE DB provider, the value for these properties can be retrieved from the Connection properties collection. For example:
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Provider = "Advantage.OLEDB.1"
cn.Properties.Item("Data Source") = "\\server\volume\path"
cn.Open
lHandle = cn.Properties.Item("ACE Connection handle")
lResult = AdsInTransaction( lHandle, bInTrans ) ‘ This returns whether the application is currently in a transaction
'Allow writing of any data to auto-increment fields
cn.Properties.Item("Enforce AutoInc") = False