Print Page | Close Window

DataProvider

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=2735
Printed Date: 21 November 2024 at 1:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DataProvider
Posted By: flauzer
Subject: DataProvider
Date Posted: 17 August 2005 at 9:15am

Is there a way to use DataProvider to SQL server 2000 ? (ie Provider=sqloledb ... ?  )

Have you plan this option?

Thanks

 

 

 




Replies:
Posted By: sserge
Date Posted: 19 August 2005 at 8:35am
Hi!

To make it working with SQL server, you should add your own code for saving/retrieving events from/to the database. To do so in VB, you could write own function to populate CalendarControl from the DB
and catch events like EventAdded, EventChanged, EventDeleted to update your array.

Look at the example which illustrates this idea. It's a code mixed with pieces of pseudo-code. Simple copy/paste wouldn't work ;)


Sub Populate()
     objCalendar.DataProvider.Remov eAllEvents

     ' There should be some your collection with events data
     ' In your case this is most likely a recordset which you get from the SQL server
     ' So, iterate this collection
     For each objEvent in objEventsCollection
           Set objCalendarEvent = objCalendar.DataProvider.CreateEventEx(objEvent.ID)

           objCalendarEvent.StartTime = ...
           ...

           objCalendar.DataProvider.AddEvent objCalendarEvent    
     Next

     objCalendar.Populate
End Sub

Private Sub CalendarControl_EventChanged(ByVal EventID As Long)
     Set objCalendarEvent = objCalendar.DataProvider.GetEvent(EventID)

     ' update data in your collection from objCalendarEvent
     ...
End Sub


Let me know if you have more questions on it.

In further versions we'll slightly change this mechanism and will add SQL Server connection sample.

--
Best regards,
Serge


Posted By: flauzer
Date Posted: 19 August 2005 at 11:19am

Thanks Serge,

I've seen Microsoft Access database (so Event, RecurrencePattern,......and other tables)...It would be nice if calendar control will update directly in SQL server. I will also try to investigate around XML feature....

I think that support for SQL will be very useful.....

Thanks.

 

 

 

 

 



Posted By: RBCDATA
Date Posted: 06 November 2005 at 7:40am

I agree

Kind Regards

René Bechmann
RBC Data




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