Multiple Schedule |
Post Reply |
Author | ||
haitaowu
Newbie Joined: 05 February 2007 Status: Offline Points: 2 |
Post Options
Thanks(0)
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!
|
||
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
|
Hi,
The following is not a good way to operate:
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:
-- WBR, Serge |
||
haitaowu
Newbie Joined: 05 February 2007 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
|
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.
|
||
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
|
In this case you can simply skip setting connection string, because the first data provider is created of Memory type by default.
-- WBR, Serge |
||
RogerHitz
Newbie Joined: 27 January 2009 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
|
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 |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |