Navigation bar
  Home Print document Start Previous page
 60 of 234 
Next page End  

Gravitybox Schedule Primer
Page 58 
1998-2004 Gravitybox Software LLC
  
  'Load this day's information from the Database
  Set Db = New ADODB.Connection
  Db.ConnectionString = GetConnectString & AppPath _
         & "schedule.mdb"
  Call Db.Open
  Set rs = New ADODB.Recordset
  Set rs = Db.Execute("select * from Room order by SortOrder")
  
  'Loop through and display all the appointments
  Call Me.Schedule1.Rooms.Clear
  While Not rs.EOF
    Set objRoom = Me.Schedule1.Rooms.Add(rs!Name)
    objRoom.Id = rs!RoomId
    Call rs.MoveNext
  Wend
  Set Db = Nothing
  Set rs = Nothing
End Sub
In this example, we are going to give the user the capability of assigning a
category to each appointment. This will give a graphical use to the schedule. The viewer
can see at a glance to which category an appointment belongs by looking at the colored
bar in its left margin. Category setup is very similar to room setup with the addition of a
color parameter. The following code will load the defined categories from the database
into the schedule’s Categories collection.
Private Sub LoadCategories()
'This procedure Loads a Schedule from the database
Dim Db As ADODB.Connection
Dim rs As ADODB.Recordset
Dim objCategory As CCategoryEl
  
  'Load this day's information from the Database
  Set Db = New ADODB.Connection
  Db.ConnectionString = GetConnectString & _
          AppPath & "schedule.mdb"
  Db.Open
  Set rs = New ADODB.Recordset
  Set rs = Db.Execute("select * from Category order by
SortOrder")
  
  'Loop through and display all the appointments
http://www.purepage.com