Print Page | Close Window

Possible bug in costum data provider

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=7333
Printed Date: 23 November 2024 at 8:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Possible bug in costum data provider
Posted By: cjprb
Subject: Possible bug in costum data provider
Date 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()
 



Replies:
Posted By: cjprb
Date Posted: 17 July 2007 at 6:46am
'bump'
 
Claus Pedersen



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