Show new event |
Post Reply |
Author | |
IDBG
Groupie Joined: 16 May 2006 Location: United States Status: Offline Points: 21 |
Post Options
Thanks(0)
Posted: 16 May 2006 at 1:11pm |
Hi! We're in the process of evaluating your software for our company. Everything works great, except for one issue. When we tried setting the Calendar Control to an SQL database, we had a serious performance issue, so we are now manually creating all events. The code is pretty simple (VB6) ... <Setup calendar/resources/schedules> The issue I have is as follows: Method 1: Method 2: In both cases, the new event won't show up until I do the following <CalendarControl.dataprovider.RemoveAllEvents> Please help! I'm probably missing something. One quick note that might help...I couldn't get the calendar to show any events until I added the following: If CalendarResourcesManager.AddDataProvider("", 0) = False Then Could this be the problem? Please help! We are in the water until we resolve this issue! Thanks!!!
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
Method 1 is not a method for adding an event. GetAllEventsRaw() is used to export all events or some similar purposes. The correct order of action would be: 1) Open data provider(s) 2) Configure resources/schedules (if you need them) 3) Add events to data provider(s). You can use following methods:
CalendarControl.DataProvider.AddEvent
CalendarResource.DataProvider.AddEvent
4) When finished adding events, call CalendarControl.Populate()When you add a single events, verify that some important properties are set correctly: StartTime, EndTime, ScheduleID, recurrence options if applicable. I'd also suggest you to look deeper at our sample applications. See VB CalendarSample for following topics: * Simple DataProviders. Open/close a data provider; connection strings for different data provider types: memory, XML/binary, DataBase, MAPI. * Resources/schedules. Simple usage; extended - using resource manager (see corresponding menu items in the sample) * Using "custom" data provider to work with custom DB. See SQL Server example. Also this forum contain a lot of information on those subjects. -- WBR, Serge |
|
IDBG
Groupie Joined: 16 May 2006 Location: United States Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Hi! Thanks for the response! I know Method 1 isn't for this purpose, but I was trying that to see if maybe it'll work that way. My app loads the Calendar in the following way: - Load list of users All this works perfectly. This screen is still open when the user click "New Appointment" On the "New Appointment" screen I save the new entry in the db Nothing happens. I've debugged and scheduleID's match, start and end times are accuarate and all other information is accurate. Is there an issue if the calendar is "manually" populated first and if you are trying to add a new event manually again? I've gone through the entire demo project line-by-line and I think I understand it well. I'm probably missing some small step somewhere..or at least I hope it's small . 2006-05-17_134906_ScrShot1.zip Thanks again! Mir |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
It would be nice if you send a piece of code which initializes calendar resources in your application, catches database events, and adds a new single event. It would allow me to analyze your steps in more details.
CalendarResourcesManager.AddDataProvider("", 0) Some more notes about data providers. For resources you have to call one of following methods:
CalendarResource.SetDataProvider(DataProvider)
CalendarResource.SetDataProvider2(ConnectionString)
Normally, 1 data provider object is enough, and for a first resource you call SetDataProvider2 to create it and for others call like:
objRCxxx.SetDataProvider(objRC0.DataProvider) Also you can use CalendarResourcesManager like:
CalendarResourcesManager.AddDataProvider("", xtpCalendarDPF_CloseOnDestroy)
objRCxxx.SetDataProvider(
CalendarResourcesManager.
DataProvider(0)
)
CalendarControl.DataProvider property works like: CalendarControl.MultipleResources(0).DataProvider Ensure that you have only one data provider for all resources. -- WBR, Serge |
|
IDBG
Groupie Joined: 16 May 2006 Location: United States Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Hi Serge, Here's the routine. Public RMan As New CalendarResourcesManager If RMan.AddDataProvider("", 32) = False Then Set pData = RMan.DataProvider(0) j = RMan.ResourcesCount <Open Recordset from database> <do while not rst.eof> Me.CalendarControl.Populate() Hope this helps. Thanks a bunch for your help! Thanks!! |
|
IDBG
Groupie Joined: 16 May 2006 Location: United States Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Serge, This is very embarassing!!!! It works fine!! My issue was I had the wrong instance of the form It works absolutely great!!! Thanks! |
|
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 |