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

Multiple Schedule

 Post Reply Post Reply
Author
Message
haitaowu View Drop Down
Newbie
Newbie


Joined: 05 February 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote haitaowu Quote  Post ReplyReply Direct Link To This Post Topic: Multiple Schedule
    Posted: 05 February 2007 at 12:04pm
Hi,
 
  I have a issue with Multiple Schedule. I am using Access 2003. I got multiple schedule shown in calendar, but no events shown. The code is shown below:
 
Private Sub Form_Load()
    Dim arResources As New CalendarResources
    Dim pRes0 As New CalendarResource
    Dim pRes1 As New CalendarResource
    Dim NewEvent As CalendarEvent
    pRes0.SetDataProvider CalendarControl.DataProvider, False
    pRes1.SetDataProvider CalendarControl.DataProvider, False
 
    Dim pSchedules As CalendarSchedules
    Set pSchedules = pRes0.DataProvider.Schedules
    If pSchedules Is Nothing Then
        Exit Sub
    End If
    If pSchedules.Count < 1 Then
        pSchedules.AddNewSchedule "John"
        pSchedules.AddNewSchedule "Terry"
        pRes0.DataProvider.Save
    End If
   
    pRes0.Name = pSchedules.Item(0).Name
    pRes0.ScheduleIDs.Add pSchedules.Item(0).Id
       
    pRes1.Name = pSchedules.Item(1).Name
    pRes1.ScheduleIDs.Add pSchedules.Item(1).Id
   
    Set NewEvent = pRes0.DataProvider.CreateEvent
    NewEvent.Subject = "test"
    NewEvent.Location = "test"
    NewEvent.StartTime = Now
    NewEvent.ScheduleID = pSchedules.Item(0).Id
    pRes0.DataProvider.AddEvent NewEvent
    pRes0.DataProvider.Save
       
    arResources.Add pRes0
    arResources.Add pRes1
    CalendarControl.SetMultipleResources arResources
    CalendarControl.Populate
End Sub
 
Thanks for any help!
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 07 February 2007 at 3:14pm
Hi,

The following is not a good way to operate:

pRes0.SetDataProvider CalendarControl.DataProvider, False
pRes1.SetDataProvider CalendarControl.DataProvider, False


The reason is that CalendarControl.DataProvider is equal to CalendarControl.Resources(0).DataProvider in a multi-resources mode.

Instead, it would be better to write:

pRes0.SetDataProvider2 "connection string", True 
pRes1.SetDataProvider pRes0.DataProvider, False


--
WBR,
Serge
Back to Top
haitaowu View Drop Down
Newbie
Newbie


Joined: 05 February 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote haitaowu Quote  Post ReplyReply Direct Link To This Post Posted: 07 February 2007 at 3:44pm
Thanks for the response.
 
We prefer not to set connection string for the calendar dataprovider. Instead, we are going to get a recordset from sql server databbase, then create events and populate calendar. We are able to get it work in single resource calendar. We are having trouble in multi-resource mode.
 
Thanks for any advice.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 07 February 2007 at 4:57pm
In this case you can simply skip setting connection string, because the first data provider is created of Memory type by default.

--
WBR,
Serge
Back to Top
RogerHitz View Drop Down
Newbie
Newbie


Joined: 27 January 2009
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote RogerHitz Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2009 at 10:15am
Hello

I am new to Codejock Calendar Pro

I have a issue with Multiple Schedule.

I don't want to set connection string for the calendar dataprovider. Instead, I will get a recordset from sql server databbase, then create events and populate calendar.

I am able to get it work in single resource calendar. But I am having trouble in multi-resource mode

How do I skip connection string and create a Memory type ?
Can you send me an VB example ?

THanks

ROGER
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.142 seconds.