Data Management

<< Click to Display Table of Contents >>

Navigation:  Apollo OLEDB > Getting Started >

Data Management

Once the Apollo OLEDB Provider is created and the Recordset uses it, all data management is defined by the RecordSet object. See the VB documentation for more details.

 

‘-------------------------------------------

Dim conn As New ADODB.Connection

Dim prov_local As String

Dim recs As New ADODB.Recordset

Private Sub Form_Load()

 

prov_local = "Provider=ApolloOLEDB7.ApolloOLEDB7;" & _

   "Data Source = c:\Apollo\9.9\Data\; " & _

   "FetchCount=50;" & _

   "AccessMethod=amLocal;" & _

   "SetTables=MailTo.dbf, MailTo, ttSXFOX, '', FALSE, '' |" & _

   "Security.dbf, Security, ttSXFOX,  '', FALSE, '' "

 

conn.Open prov_local

 

' adCmdText is used for SQL access

' adCmdTableDirect is used for direct table access

 

recs.Open "Security", conn, adOpenDynamic, adLockOptimistic, adCmdTableDirect

Set DataGrid1.DataSource = recs

 

End Sub

 

 

Connection string for SQL:

 

‘-------------------------------------------

Dim conn As New ADODB.Connection

Dim prov_local As String

Dim recs As New ADODB.Recordset

Dim sSQL As String

Private Sub Form_Load()

 

prov_local = "Provider=ApolloOLEDB9.ApolloOLEDB9;" & _

   "Data Source = c:\Apollo\9.9\Data\; " & _

   "FetchCount=50;" & _

   "AccessMethod=amLocal;" & _

   "SetTables=MailTo.dbf, MailTo, ttSXFOX, '', FALSE |" & _

   "Security.dbf, Security, ttSXFOX,  '', FALSE, '' "

 

conn.Open prov_local

 

' adCmdText is used for SQL access

' adCmdTableDirect is used for direct table access

 

sSQL = "Select UserName, Password, Limited " & _

 "From Security Where UserName Like 'A%'"

 

recs.Open sSQL, conn, adOpenDynamic, adLockOptimistic, adCmdText

Set DataGrid1.DataSource = recs

 

End Sub