Programming Notes for Pervasive OLE DB Provider
Show this topic in Library frames
The following section lists notes about the Pervasive OLEDB driver:
Seek with Static Cursors
To use seek on a static cursor, the index must be set before opening the result set. For example:
Dim rs AsNew ADODB.Recordset
rs.Index = "segment"
rs.Open "Simple", "Provider=PervasiveOLEDB;Data
Source=MyData", adOpenStatic, adLockOptimistic,
adCmdTableDirect
rs.Seek Array(2, 9)
rs.Close
Remote Connections
Pervasive's OLE DB provider cannot create a remote connection. This means you cannot set a remote server within the connection string. However, there are alternatives for our provider to perform the same functionality.
- Use RDS, which has been tested with the Pervasive provider
- Develop a business object using COM+ services, and create the object using CreateObject. For example:
Dim m_busObj As projDLL.busObj
rs As New ADODB.Recordset
Set m_busObj =
CreateObject("sampProj2.TwoPhaseSampleProduct",
"RemoteServer")
Set rs = m_busObj.GetData()
Table Definitions
ITableDefinition does not support creation of the following columns because they are not supported by the underlying Pervasive.SQL engine.
- BSTR
- WCHAR
- VarWChar
- LongVarWChar
- UserDefined Types
- GUID
Default LockType
If no LockType is specified, the cursor is set to immediate update mode. This has a couple of repercussions:
- All changes are immediately transferred to the database (without the need to call update)
- Update and UpdateBatch really have no meaning (as the database is already updated). However, the Supports method will still return true of update, but will return false for UpdateBatch.
- GetOriginalValue is not usable.
To programmatically determine when GetOriginalValue is available, you must use the "supports" method with adUpdateBatch as the argument. For example:
if rs.Supports(adUpdateBatch) then
someValue = rs.fields(iCol).OriginalValue
end if
Initialization Properties
The following table lists the properties Pervasive supports for initialization in OLE DB, and the corresponding connection string identifiers
Table 2-3 Connection String Identifiers
|
Connection String Identifier
|
Property
|
|
Cache Authentication
|
DBPROP_AUTH_CACHE_AUTHINFO
|
|
Connect Timeout
|
DBPROP_INIT_TIMEOUT
|
|
Data Source
|
DBPROP_INIT_DATASOURCE
|
|
Encrypt Password
|
DBPROP_AUTH_ENCRYPT_PASSWORD
|
|
Locale Identifier
|
DBPROP_INIT_LCID
|
|
Location
|
DBPROP_INIT_LOCATION
|
|
Password
|
DBPROP_AUTH_PASSWORD
|
|
Persist Encrypted
|
DBPROP_AUTH_PERSIST_ENCRYPTED
|
|
Persist Security Info
|
DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO
|
|
User ID
|
DBPROP_AUTH_USERID
|
You can also set the following properties: