How do I connect the component to a database?


Most DBI components are not databound and do not support simple data binding.  The majority of our customers choose to bind the components to a database.  It is completely up to the developer to decide how to connect them.  Many of our clients choose to connect the component to a database using ADO.  Please note the example below which illustrates how to create an ADO connection.

The following demonstrates how to load the control ctDays with information from a database:

Private Sub ctDays_FirstDraw()
'Get path to database
m_dbPath = App.Path + "\Data.mdb"
'Open the database
Set m_dbApp = OpenDatabase(m_dbPath)
' set up record sets for Appointments
Set TableName = m_dbApp.OpenRecordset("TableName")
 
'Move the table to it's first record
TableName.MoveFirst
Do While Not TableName.EOF()
'The following line will add the appointment to the control
nIndex = ctDays.AddKeyAppointment(TableName!StartTime, TableName!EndTime, TableName!Text, TableName!AppID)
'Go to the next record
TableName.MoveNext
Loop
TableName.Close
End Sub