Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Possible bug in costum data provider
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Possible bug in costum data provider

 Post Reply Post Reply
Author
Message
cjprb View Drop Down
Newbie
Newbie


Joined: 08 June 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote cjprb Quote  Post ReplyReply Direct Link To This Post Topic: Possible bug in costum data provider
    Posted: 08 June 2007 at 5:25am
Hi all
 
Below is the code i have written to set up the events for a multi resource calendar. Everythink works as expected, except that when i use a costom data provider the events dosent show up in the calendar. If i use the "memory" data provider they do. The lines in bold are the only lines i have changed to make it work.
 
I changed the line
 
lo_resource.SetDataProvider2("Provider=custom;DSN=MyOracle",true)
 
to
 
lo_resource.SetDataProvider2("Provider=XML;Data Source=c:\temp\schedule.xml",true)
 
and then the events showed up in the calendar.
 
I dont read anything from the dataprovider, all my data is comming from the database and must be saved there again. So im asking, am i doing something wrong here in the code for the costum dataprovider ?
 
Thanks for your time
 
Claus
 

 lo_resources = CREATE OLEObject
 li_ret = lo_resources.ConnectToNewObject("Codejock.CalendarResources.11.1.3")

ll_antMed = myBesog.med_list.of_Get(medarb_nodes)
FOR li_medarb = 1 to ll_antMed
 medarb_nodes[li_medarb].of_getdata(la_temp)
 l_medarb = la_temp
 
 lo_resource = CREATE OLEObject
 li_ret = lo_resource.ConnectToNewObject("Codejock.CalendarResource.11.1.3")
 
 if li_medarb = 1 then
  // we will use a costom data provider
 // lo_resource.SetDataProvider2("Provider=custom;DSN=MyOracle",true)
  lo_resource.SetDataProvider2("Provider=XML;Data Source=c:\temp\schedule.xml",true)

  if not lo_resource.DataProvider.Open() then
   lo_resource.DataProvider.create()
  end if
  lo_schedules = lo_resource.DataProvider.Schedules();
  lo_res1 = lo_resource
 else
  lo_resource.SetDataProvider(lo_res1.DataProvider(),false)
 end if
 
 lo_schedules.AddNewSchedule(l_medarb.ini);
 lo_schedules.item(li_medarb - 1).id = l_medarb.id

 lo_resource.name = l_medarb.ini
 lo_resource.ScheduleIDs.Add(l_medarb.id)
 
 lo_resources.Add(lo_resource)
 
NEXT
 
// Get the events
OLEObject ptrEvent

besoeg_list = myBesog.of_get_besoeg( )
ll_AntVisit = besoeg_list.of_Get(besoegs_nodes)

FOR li_visit = 1 to ll_AntVisit
 besoegs_nodes[li_visit].of_getdata(la_temp)
 l_besoeg = la_temp
 
ls_body = "Test body"

  // Make a new event
 ptrEvent = lo_res1.DataProvider.CreateEvent()
 ptrEvent.Subject = l_besoeg.name
 ptrEvent.StartTime = l_besoeg.starttime
 ptrEvent.EndTime = l_besoeg.endtime
 ptrEvent.Body = ls_body
 ptrEvent.ScheduleID = l_besoeg.med_id
 lo_res1.DataProvider.AddEvent(ptrEvent)

NEXT

gruppetavle.object.SetMultipleResources(lo_resources)
 
gruppetavle.object.Populate()
 
Back to Top
cjprb View Drop Down
Newbie
Newbie


Joined: 08 June 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote cjprb Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2007 at 6:46am
'bump'
 
Claus Pedersen
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.141 seconds.