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

DataProvider

 Post Reply Post Reply
Author
Message
flauzer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 December 2003
Location: Italy
Status: Offline
Points: 108
Post Options Post Options   Thanks (0) Thanks(0)   Quote flauzer Quote  Post ReplyReply Direct Link To This Post Topic: DataProvider
    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

 

 

 



Edited by flauzer
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: 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
Back to Top
flauzer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 December 2003
Location: Italy
Status: Offline
Points: 108
Post Options Post Options   Thanks (0) Thanks(0)   Quote flauzer Quote  Post ReplyReply Direct Link To This Post 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.

 

 

 

 

 

Back to Top
RBCDATA View Drop Down
Newbie
Newbie
Avatar

Joined: 06 November 2005
Location: Denmark
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote RBCDATA Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2005 at 7:40am

I agree

Kind Regards

René Bechmann
RBC Data

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.202 seconds.