Print Page | Close Window

Load Today's event

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=5269
Printed Date: 08 July 2024 at 5:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Load Today's event
Posted By: cmm2006
Subject: Load Today's event
Date Posted: 11 October 2006 at 2:33pm
Hi,
How can I be able to load the list of all todays event in listbox (only today's event)?
Thank you! :)
 



Replies:
Posted By: sserge
Date Posted: 11 October 2006 at 4:02pm
Hi,

Use RetrieveDayEvents method:


CalendarControl.DataProvider.RetrieveDayEvents(Now)


--
WBR,
Serge


Posted By: cmm2006
Date Posted: 11 October 2006 at 4:58pm
Hi Sserge,
can you explain how to use CalendarControl.DataProvider.RetrieveDayEvents(Now), with a lisbox?
Thank you,


Posted By: sserge
Date Posted: 12 October 2006 at 3:12am
Well, you'll have to code a bit 


Dim DayEvents As CalendarEvents
Set DayEvents = CalendarControl.DataProvider.RetrieveDayEvents(Now)
For i = 0 To DayEvents.Count - 1
    List1.AddItem DayEvents(i)
    List1.ItemData(i) = DayEvents(i).Id
Next


--
WBR,
Serge


Posted By: cmm2006
Date Posted: 12 October 2006 at 2:23pm
Thank you


Posted By: SteveB
Date Posted: 17 January 2007 at 10:14am
Can you give a little more info as to how this could be used to populate the day's calendar rather than a listbox?


Posted By: sserge
Date Posted: 17 January 2007 at 4:52pm
Originally posted by SteveB SteveB wrote:

Can you give a little more info as to how this could be used to populate the day's calendar rather than a listbox?


What do you mean?

Note that if you set up a Calendar to show some day, it will internally use this method to retrieve corresponding events from a data provider.

--
WBR,
Serge


Posted By: SteveB
Date Posted: 18 January 2007 at 7:11pm
I am trying to load just one day's events as the Event table is quite large and appears to be effecting applicaiton performance when I try to switch days.
 
Can you also provide some additional guidance on using a custom data provider? I am thinking that I will have to use my own tables/fields......


Posted By: sserge
Date Posted: 19 January 2007 at 2:54pm
Have you read this link: http://www.codejock.com/support/articles/com/calendar/cp_3.asp - http://www.codejock.com/support/articles/com/calendar/cp_3.asp ?

Also search forum for "custom data provider" keywords and you'll find a lot of information...

--
WBR,
Serge


Posted By: SteveB
Date Posted: 19 January 2007 at 4:03pm
I have but, quite frankly, it is quite sparse on details.
 
I am looking to potentially connect to an Access DB. While I realize the built in DataProvider is for Access, there are other fields that I essentially need!
 
Any assistance would be appreciated!


Posted By: SteveB
Date Posted: 19 January 2007 at 4:16pm
Perhaps what I am looking for is just a way to populate the calendarcontrol via a recordset.....
 
can this be done even without a custom dataprovider?
 


Posted By: sserge
Date Posted: 19 January 2007 at 4:23pm
Well, you can't populate the control with a recordset because its data provider has a richer behavior.

But if your task is just to enhance a standard appointment with additional fields (as far as I understood from your explanations) -- then the solution is quite simple.

You can use a standard Access Data Provider. Just run it once to create an MDB file with the structure which is required for Calendar. Then you can enhance this structure in any way you need, but do not delete or rename any fields, do not change their types. Control's data provider then will use only those fields which it really needs. And you in your code can use all other custom fields.

--
WBR,
Serge


Posted By: SteveB
Date Posted: 19 January 2007 at 4:35pm
thanks for responding so quickly.
 
Well then it sounds like I will need a custom dataprovider...
 
can you please provide a little guidance?
 
thanks!


Posted By: sserge
Date Posted: 19 January 2007 at 4:40pm
For understanding a custom data provider I would firstly suggest you to read the mentioned article. And for creating a data provider I would suggest you to try debugging any of our samples with it included. You'll see which methods are called, and what it a sequence of calls...

--
WBR,
Serge


Posted By: SteveB
Date Posted: 19 January 2007 at 4:44pm
but aren't your custom data providers in sample just for SQL/mySQL???
 
How could I use with access???


Posted By: sserge
Date Posted: 19 January 2007 at 5:15pm
They both are using ADODB to connect to database.

You can use it for Access as well.

--
WBR,
Serge


Posted By: SteveB
Date Posted: 21 January 2007 at 1:49pm
I've managed to populate the calendar using:
 

Dim strconn As String
strconn = "Provider=Custom;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & App.Path & "\Data\Events.mdb;"
Call OpenProvider(cjCalendarData_SQLServer, strconn)
 
However, my multipe resources are gone.
It shows up as one calendar and all appointments are in that one calendar, not divided by resource.....
 
help!
 


Posted By: sserge
Date Posted: 22 January 2007 at 2:42am
Visible Schedules configuration is not stored/restored automatically. You have to write some lines of code to do this as you need.
 
For built-in Access DataProvider DataProvider.Schedule collection Stored/Loaded on Save/Open but how to configure calendar for schedules look at our samples.
 
VB Sample,  frmMain
    mnuMultiSchedulesSimple_Click
 
There is a helper object CalendarResourcesManager which can help to handle complex (andd simple) situations.
See
    mnuMultiSchedulesExtended_Click
 
--
WBR,
Serge



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net