Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Open with Recordset
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Open with Recordset

 Post Reply Post Reply
Author
Message
ampcom View Drop Down
Groupie
Groupie


Joined: 20 September 2008
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ampcom Quote  Post ReplyReply Direct Link To This Post Topic: Open with Recordset
    Posted: 08 June 2009 at 3:41pm
Hi,
 
Can anyone give an example of retrieving calendar data from access database using a recordset / filter? (I don't want the calendar to retrieve all records in the Events table).
 
I have searched through the forums and cannot find any suggestions.
 
Thanks in advance for any pointers
 
Product: Xtreme SuitePro (ActiveX) version 15.0.1
Platform: Windows 7 (64 Bit) Ultimate
Language: Visual Basic 6.0
Back to Top
ampcom View Drop Down
Groupie
Groupie


Joined: 20 September 2008
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ampcom Quote  Post ReplyReply Direct Link To This Post Posted: 21 June 2009 at 4:47pm

Has anyone got an example they could share of modifying the Custom Provider (SQL) example to use an Access database.

Have tried tech support which was a waste of time - they just say see the example.  Help or what!!
 
Product: Xtreme SuitePro (ActiveX) version 15.0.1
Platform: Windows 7 (64 Bit) Ultimate
Language: Visual Basic 6.0
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 20 July 2009 at 11:10am
To filter you can use the PrePopulate event combined with something like CustomProperties as a filter.

Here is one way to filter events. It is a very basic sample using PrePopulate.

This sample assumes you have a custom property called "Name" for your events, and some global variable named strName that holds the name of the user you want to view. The sample below will see if the event has a property with "name", if it doesn't, then it checks to see if the name is equal to strName, if it's not, it will hide it (this only hides the event, not remove it from the data source).

You can use Prepopulate event to hide some events in the Calendar display.

Private Sub CalendarControl_PrePopulate(ByVal ViewGroup As XtremeCalendarControl.CalendarViewGroup, ByVal Events As XtremeCalendarControl.CalendarEvents)

    If Events.Count > 0 Then
        Dim i As Long
        For i = Events.Count - 1 To 0 Step -1
            If Not Events(i).CustomProperties("name") = "" Then
                If Not Events(i).CustomProperties("name") = strName Then
                    Events.Remove i
                End If
            End If
        Next
    End If
End Sub

Here is another version:


This assumes you have some BOOL that specifies when filtering is enabled (bFilterMode). Also assumes your filter text is stored in a global variable (sFilterText)

The sample simply compares the Subject of the event to some text, if they match, then the event will be displayed, if they don't match, it is not displayed. This is only visual, no data is removed from the database.

Obviously you can improve on the compare, the following sample assumes an exact match.

Private Sub CalendarControl_PrePopulate(ByVal ViewGroup As XtremeCalendarControl.CalendarViewGroup, ByVal Events As XtremeCalendarControl.CalendarEvents)

 Dim pEvent As CalendarEvent
 Dim x As Integer
 x = 0
  
 For Each pEvent In Events
  If bFilterMode Then
   If pEvent.Subject <> sFilterText Then
    Events.Remove x
   End If
   x = x + 1
  End If
 Next
  
End Sub

Hope this helps
Back to Top
ampcom View Drop Down
Groupie
Groupie


Joined: 20 September 2008
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ampcom Quote  Post ReplyReply Direct Link To This Post Posted: 20 July 2009 at 12:49pm
Hi,
 
Appreciate your feedback and suggestions
 
Regards
 
Tony
 
Product: Xtreme SuitePro (ActiveX) version 15.0.1
Platform: Windows 7 (64 Bit) Ultimate
Language: Visual Basic 6.0
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.