PreviousOLE DB Provider Guide ( revision 1) Next

Programming Notes for Pervasive OLE DB Provider

Show this topic in Library frames

The following section lists notes about the Pervasive OLE DB provider:

Visibility of Updates

Updates made to a table with adCmdTableDirect will be visible to a Command-based recordset.

For example, consider the following sequence of events:

In this scenario, the updates made transactionally are visible to the SQL query.

Using the OLE DB Provider with a UNC Path or Mapped Drive

This section describes a situation that occurs if you are using the Pervasive OLE DB provider in conjunction with a mapped drive or UNC path in the Data Source portion of the connection string. For example:

Provider=PervasiveOLEDB;Data Source=\\servername\path 

In the previous version of the provider, this connection string would automatically resolve to the correct database name. Using the current provider, you may encounter permissions issues with this configuration. You will not have any permissions issues if you use the new Location parameter in your connection string. See Remote Connections for more information on the Location parameter.

If a client tries to connect to a server, and the client's data source is a UNC path, the provider must resolve the path to a database name and server name. In order for the OLE DB provider to obtain this information, the client's user account must have Administrative or Power User permissions on the server in order to resolve this path.

In many configurations, the client's user account may not have these necessary permissions. If the client does not have sufficient permissions, the OLE DB provider displays a dialog similar to Figure 2-1 , allowing the user to enter the database name and server name.

Figure 2-1 Resolution Dialog for DBname and Server Name

If you check Save above settings to registry, then the entries will be saved to the Windows registry and Figure 2-1 will no longer display for the referenced UNC or mapped drive location. Instead, the database name will be resolved using the registry, which offers a performance improvement. The registry location used is:

SOFTWARE\Pervasive Software\OLEDB\Connections 

If you as a developer want to avoid the display of this dialog to your end-users, you can enter the necessary information in the Windows registry, in the following format under the preceding key:

Name
Value
UNC Path to data
Servername;DbName

For example:

Name
Value
\\myserver\c\pvsw\demodata
myserver;demodata

You can have multiple UNC entries that point to the same database name if necessary.

Support for ADO Refresh Method Examples

The following shows examples of the ADO Refresh method using a parameterized query and a stored procedure.

Example Using Parameterized Query

connstr = "Provider=PervasiveOLEDB;Data 
Source=Demodata" 
cn.Open connstr 
cmd.ActiveConnection = cn 
 cmd.CommandType = adCmdText 
 cmd.CommandText = "Select  * From Room where 
Building_Name = ?" 
'Refresh parameters 
 cmd.Parameters.Refresh 
 cmd.Parameters(0).Value = "Bartold Building" 
 cmd.Execute 

Example Using Stored Procedure

connstr = "Provider=PervasiveOLEDB;Data 
Source=Demodata" 
cn.Open connstr 
' Call Stored procedure 
cmd.ActiveConnection = cn 
cmd.CommandText = "PROCOUT" 
cmd.CommandType = adCmdStoredProc 
cmd.Parameters.Refresh 
cmd.Execute 
Debug.Print cmd.Parameters(0).Value 

Chapter contents
Publication contents

Prev topic: Pessimistic Cursors
Next topic: Programming Notes for Pervasive OLE DB Provider