<< Click to Display Table of Contents >> Navigation: Apollo COM > Getting Started > Getting Started |
Apollo COM's two main objects are Table and Query. Each allow you to access local tables or remote tables through the Apollo Database Server simply by changing the AccessMethod and setting the correct DatabaseName properties.
The Table object allows you to access tables directly in local or client/server mode.
The Query object uses the Apollo SQL query engine to manage data files using SQL commands.
Table
VB syntax
Private Sub Command1_Click()
Dim oTable As Object
Dim last, first As String
Dim age, recs As Integer
' Local data access
Set oTable = CreateObject("ApolloCOM9.Table")
' Apollo can access data directly or it can connect to
' the Apollo Server ("amServer") and operate in client/server mode
oTable.AccessMethod = "amLocal"
oTable.DatabaseName = "c:\Apollo\9.0\x86\Data\"
oTable.TableName = "Test.DBF"
oTable.Open
oTable.GoTop
While Not oTable.EOF
first = Trim(oTable.GetString("FIRST"))
last = Trim(oTable.GetString("LAST"))
age = oTable.GetInteger("AGE")
list.AddItem (first + " " + last + " " + CStr(age))
oTable.Skip (1)
Wend
oTable.Close
Set oTable = Nothing
End Sub