|
When using the Pervasive OLE DB provider, a common question is how to connect to the database. This section details the basics of connecting using the OLE DB provider.
Private Sub Form_Load() Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset 'This should always be adUseServer unless you 'specifically want to use the Client Cursor Engine cn.CursorLocation = adUseServer cn.ConnectionString = "Provider=PervasiveOLEDB;Data Source=Demodata" cn.Open rs.Open "Billing", cn, adOpenDynamic, adLockOptimistic, adCmdTableDirect rs.MoveFirst MsgBox "The first Student ID: " & rs.Fields("Student_ID") rs.Close cn.Close End Sub
Other common procedures are documented in Chapter 3, ADO/OLE DB Reference Information.
|
Chapter contents
Prev topic: Programming with the Pervasive OLE DB Provider
|