Print Page | Close Window

Setting up Multiple resources

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


Topic: Setting up Multiple resources
Posted By: Freq
Subject: Setting up Multiple resources
Date Posted: 11 April 2006 at 10:48pm

I'm very interested in your product.  I'm currently evalling it to see if it will work with our software.  I need the calendar to be able to view the schedules of multiple people in 1 dayview.  I'm having a hard time setting up multiple resources. 

Do you have any tutorials specific to this?  When I use the VB CalendarControl sample and click 'Load Multischedules(Extended) I get the following error (Object variable or With block variable not set).

Do you have a simple working sample that will show the basics of how to setup multiple resources/schedules in 1 day view?




Replies:
Posted By: sserge
Date Posted: 12 April 2006 at 10:14am
Hello,

What you describe should be working properly...

Could you please specify more information about this problem. What environment do you use (Visual Basic 6.0 ?) Does it show a place in the code where it hangs up? Can you open frmMain in design mode? Does Load Multischedules(Simple) work fine ?

Actually, VB sample is what you need: it has a code which shows how to use multi-schedules.

--
WBR,
Serge


Posted By: Freq
Date Posted: 12 April 2006 at 11:17am

I'm using VB6.  I'm using the Calendar Sample for VB6.You mentioned 'VB Sample' is that sample different from the one I am currently working with?  If so, where can I get it?

It hangs up on frmEditEvent in the cmdOK sub at 'If m_pEditingEvent.RecurrenceState <> xtpCalendarRecurrenceMaster Then' the var 'm_pEditingEvent.RecurrenceState' is not set.

Multischedules(simple) seems to hang at the same spot too.



Posted By: sserge
Date Posted: 13 April 2006 at 11:34am
We have only 1 VB6 sample. But I can not reproduce your problem

Let me ask more questions on that:
-- are you using the latest release: 7 April, 2006 Q1 ? (Calendar control version 10.1). If no, please download and try this one.
-- what is your environment? Windows version, SP, VB6 version (from its About Box), your default locale?
-- what are your steps to reproduce
frmEditEvent: the var 'm_pEditingEvent.RecurrenceState' is not set ?
-- which DataProvider do you use? is it default file/memory data provider?

--
Best regards,
Serge


Posted By: Freq
Date Posted: 13 April 2006 at 3:05pm

I reinstalled the trial software and it no longer hangs there.  (I may have edited the code and caused a prob).

With the fresh install, I start it, click Dayview, the File/Load Sample multischedules(simple) and it doesn't change the view.

File/Open Resources Manager and add 2 resources and it doesn't change the view. -- no new columns.

Please give some sample code that shows in the simplest way possible, the steps to create a calendar with 2 or 3 columns(different person in each column).



Posted By: sserge
Date Posted: 16 April 2006 at 3:07pm
Freq,

1) I've created a very basic Calendar MultiSchedules sample for you, please find it there (see below for a working link).

2) Please also look at standard Calendar VB sample, hopefully it will be useful for you.

--
WBR,
Serge


Posted By: migue
Date Posted: 02 August 2006 at 4:19am
sserge,
 
   I'd like to check these samples that you update but I can't download them.
 
  Could you send me the correct links... I'm very interesting in this component and Iwant to check the simple funcionalities before buying.
 
   Thanks,Smile
 
  Migue


Posted By: sserge
Date Posted: 02 August 2006 at 6:58am
Hi Migue,

Full Calendar VB sample is available within the evaluation package.

See below for a code of a simple multi-resources example. Add a Calendar control to the form, and add a code like:

Private Sub Form_Load()

    '// Setup sample configuration
    '// ** data provider
    Dim strConnectionString As String
    strConnectionString = "Provider=XML;Data Source=" & App.Path & "\" & "CalendarMultipleSchedulesSample.xml"
   
    Dim arResources As New CalendarResources
    Dim pRes0 As New CalendarResource
    Dim pRes1 As New CalendarResource
   
    pRes0.SetDataProvider2 strConnectionString, True
     
    If pRes0.DataProvider Is Nothing Then
        Debug.Assert False
        Exit Sub
    End If
   
    If Not pRes0.DataProvider.Open Then
        If Not pRes0.DataProvider.Create Then
            Debug.Assert False
            Exit Sub
        End If
    End If
   
    '// ** schedules
    Dim pSchedules As CalendarSchedules
    Set pSchedules = pRes0.DataProvider.Schedules
   
    If pSchedules Is Nothing Then
        Exit Sub
    End If
   
    If pSchedules.Count < 1 Then
        pSchedules.AddNewSchedule "John"
        pSchedules.AddNewSchedule "Jane"
       
        pRes0.DataProvider.Save
    End If
   
    '// ** resources
   
    pRes0.Name = pSchedules.Item(0).Name
    pRes0.ScheduleIDs.Add pSchedules.Item(0).Id
   
    pRes1.SetDataProvider pRes0.DataProvider, False
    pRes1.Name = "Jane (+8 hr)" 'pSchedules.Item(1).Name
    pRes1.ScheduleIDs.Add pSchedules.Item(1).Id
     
    arResources.Add pRes0
    arResources.Add pRes1
       
    wndCalendar.SetMultipleResources arResources
   
    wndCalendar.Populate

End Sub

Private Sub Form_Resize()
    On Error Resume Next
    Dim nHeight As Long
    nHeight = ScaleHeight - wndCalendar.Top
   
    wndCalendar.Move 0, wndCalendar.Top, ScaleWidth, nHeight
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If Not wndCalendar.DataProvider Is Nothing Then
        wndCalendar.DataProvider.Save
    End If
   
End Sub


Also below is the contents of the calendarmultipleschedulessample.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<Calendar CompactMode="1" Version="1">
    <Options WorkDayStartTime="08:00:00" WorkDayEndTime="17:00:00" DayView_Scale2TimeZone="IIPPPPPPHEAAEFAACEAAACAADFAAEHAABGAAOGAAEGAABGAACHAAEGAAACAAEFAAJGAANGAAFGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAFAAADAAAAAAAAAAAAAAAAAAAAAAAHEAAEFAACEAAACAADFAAEHAABGAAOGAAEGAABGAACHAAEGAAACAAEFAAJGAANGAAFGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAFAAACAAAAAAAAAAAAAAAEMPPPPPP"/>
    <Events>
        <Event ScheduleID="2" EventID="-2" StartTime="2006-01-08T07:30:00" EndTime="2006-01-08T08:00:00" Subject="gg" BusyStatus="2" CreationTime="2006-14-04T18:28:42" LastModificationTime="2006-02-08T14:55:47"/>
        <Event ScheduleID="1" EventID="-3" StartTime="2006-01-08" EndTime="2006-04-08" Subject="11" AllDayEvent="1" CreationTime="2006-14-04T18:28:51" LastModificationTime="2006-02-08T14:55:47"/>
        <Event ScheduleID="1" EventID="-4" StartTime="2006-01-08T01:30:00" EndTime="2006-01-08T02:00:00" Subject="www" BusyStatus="2" CreationTime="2006-14-04T18:28:55" LastModificationTime="2006-02-08T14:55:47"/>
        <Event ScheduleID="2" EventID="-5" StartTime="2006-01-08T04:30:00" EndTime="2006-01-08T05:00:00" Subject="eee" BusyStatus="2" CreationTime="2006-14-04T18:29:00" LastModificationTime="2006-02-08T14:55:47"/>
        <Event ScheduleID="2" EventID="-6" StartTime="2006-03-08T03:00:00" EndTime="2006-03-08T03:30:00" Subject="456" BusyStatus="2" CreationTime="2006-14-04T18:29:04" LastModificationTime="2006-02-08T14:55:47"/>
    </Events>
    <EventsSchedules>
        <Schedule ID="1" Name="John"/>
        <Schedule ID="2" Name="Jane"/>
    </EventsSchedules>
</Calendar>


--
WBR,
Serge


Posted By: migue
Date Posted: 03 August 2006 at 11:00am
Ok, thanks... I want to work with MS Access but my database has got a password ... How can I create the provider with password in your connection... I've tried with this sentence but doesn´t work:
 
      OpenProvider "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & cadena & ";Persist Security Info=False;Jet OLEDB:Database Password=xxx"
 
Thanks..
 
   Miguel


Posted By: PeySoft
Date Posted: 07 August 2006 at 11:08am
Hi there
 
me again
 
try using  
 
CalendarControl1.SetDataProvider Application.CurrentDB


-------------
MS Access Expert
(or trying to be!)


Posted By: PeySoft
Date Posted: 10 August 2006 at 2:59pm
Sorry about that! Just read the whole thread. This will only work if using Access as the front end.

-------------
MS Access Expert
(or trying to be!)


Posted By: sserge
Date Posted: 24 August 2006 at 4:50am
Originally posted by migue migue wrote:

Ok, thanks... I want to work with MS Access but my database has got a password ... How can I create the provider with password in your connection... I've tried with this sentence but doesn´t work:
 
      OpenProvider "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & cadena & ";Persist Security Info=False;Jet OLEDB:Database Password=xxx"
 
Thanks..
 
   Miguel


Was working for me fine, the only change is to take data source filename into single quotes:

   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & App.Path & "\" & strPath & "';Persist Security Info=False;Jet OLEDB:Database Password=xxx"

--
WBR,
Serge


Posted By: sserge
Date Posted: 24 August 2006 at 4:53am
see also http://support.microsoft.com/kb/191754/ - http://support.microsoft.com/kb/191754/


Posted By: DikkeLeo
Date Posted: 14 October 2006 at 6:25am
Hello,
I've tried the multiple resources, but I can save them to a MySQL database, BUT I can't retreive them!
I hope somebody can help me with this one.


Posted By: sserge
Date Posted: 14 October 2006 at 11:10am
Originally posted by DikkeLeo DikkeLeo wrote:

Hello,
I've tried the multiple resources, but I can save them to a MySQL database, BUT I can't retreive them!
I hope somebody can help me with this one.


We can try to help, but there is not enough problem details described there. Try to be more specific.

--
WBR,
Serge


Posted By: DikkeLeo
Date Posted: 09 November 2006 at 5:03am
(I use the VB6 version 10, and yes, I bought the license)
I altered the following:
in frmMain:
'OpenProvider cjCalendarData_Memory, "Provider=XML;Data Source=" & App.Path & "\Events.xml"
    OpenProvider cjCalendarData_MySQL, "Provider=Custom;DSN=wingymsql"
I use MySQL 4.14 on a Windows machine

in:
Private Sub mnuMultiSchedulesSimple_Click()
'strConnectionString = "Provider=XML;Data Source=" & App.Path & "\" & "CalendarMultipleSchedulesSample.xtp_cal"
    strConnectionString = "Provider=Custom;Data Source=wingymsql"
so the data is not stored in XML, but in MySQL. It is stored in the MySQL database but when I restart the application and I click this function, no data is shown. But when I do not click this function, I see the previously entered data.
I hope you can help me with this.
Thanks in advance.

greetings


Posted By: sserge
Date Posted: 09 November 2006 at 4:28pm
Hi, I think I understand your problem.
Custom data provider example for version 10 does not use (read/write) ScheduleID Event property.
 
Please add support for ScheduleID property in the same way as this is done for LabelID.
 
This was added to VB sample for version 10.3.1.
You can download it to compare.
 
Also do not forget to add such field to your DB Table.
 
--
WBR,
Serge


Posted By: DikkeLeo
Date Posted: 09 November 2006 at 5:35pm
Hello Serge,
Yes, I added the field ScheduleID to the table. Entered with the example two MultiSchedule events, the field ScheduleID in the table was still 0 (zero) for both events. I stopped the program, changed for the first event the field ScheduleID to 1, and the second to 2. Now they re-appear at the right column! But the ScheduleID field is not automatically changed by the sample program.
I'll have to look at the code for the reason.
Greetings, and thanks for your support. It's a great tool!


Posted By: DikkeLeo
Date Posted: 09 November 2006 at 6:02pm
There's an error in frmEditEvent.frm
if you try to save an existing MultiSchedule event, an error is generated at m_pCalender.DoUpdateEvent
The strSQL = m_pHelper.MakeUpdateEventSQL(pEvent) generates a falls SQL query!
The query I got was:
UPDATE CalendarEvents SET
Subject = "john 100",
Location = "",
Body = "",
IsMeeting = 0,
IsPrivate = 0,
LabelID = 0,
BusyStatus = 2,
ImportanceLevel = 1,
StartDateTime = {ts'2006-11-07 09:30:00'},
EndDateTime = {ts'2006-11-07 11:30:00'},
IsAllDayEvent = 0,
IsReminder = 0,
ReminderMinutesBeforeStart = 15,
RemainderSoundFile = "",
RecurrenceState = 0,
RecurrencePatternID = 0,
RExceptionStartTimeOrig = {ts'1899-12-30 00:00:00'},
RExceptionEndTimeOrig = {ts'1899-12-30 00:00:00'},
ISRecurrenceExceptionDeleted = 0,
CustomPropertiesXMLData = "<Calendar CompactMode=\"1\"/>
"
CustomIconsIDs = ""
ScheduleID = 1,
WHERE EventID = 4;
You see the comma behind ScheduleID = 1, this is not allowed. Can you tell me where in the code I can delete this last comma?
Thanks in advance.



Posted By: DikkeLeo
Date Posted: 09 November 2006 at 6:05pm
found it!


Posted By: DikkeLeo
Date Posted: 09 November 2006 at 6:16pm
in MakeCreateEventSQL is an error:
the line
    strSQL = strSQL + "ScheduleID = " & pEvent.ScheduleID & ");" & vbCrLf

must be changed to:
    strSQL = strSQL & pEvent.ScheduleID & ");" & vbCrLf


Posted By: sserge
Date Posted: 10 November 2006 at 4:49am
Ok, thanks. Will fix those 2 errors.


Posted By: mindserve
Date Posted: 20 January 2007 at 2:32pm
These are dead links...can you repost the samples?
1) I've created a very basic Calendar MultiSchedules sample for you, please find it there:  http://forum.codejock.com/uploads/sserge/2006-04-16_150350_Calendar_MultiSchedules_simple.zip - 2006-04-16_150350_Calendar_MultiSchedules_simple.zip

2) Please also find updated standard Calendar VB sample, hopefully it will be useful for you: http://forum.codejock.com/uploads/sserge/2006-04-16_150628_CalendarSampleUpd.zip - 2006-04-16_150628_CalendarSampleUpd.zip


Posted By: sserge
Date Posted: 21 January 2007 at 4:05pm
Originally posted by mindserve mindserve wrote:

These are dead links...can you repost the samples?


Forum looks to remove old attachments...

Here it is: uploads/20070121_160444_CalendarSchedul.zip - uploads/20070121_160444_CalendarSchedul.zip

--
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