Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - "Provider=memory"  to custom folder
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

"Provider=memory" to custom folder

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


Joined: 02 October 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote guru4 Quote  Post ReplyReply Direct Link To This Post Topic: "Provider=memory" to custom folder
    Posted: 02 October 2009 at 5:41am
Hi,

My Calendar Multiressources with Provider=memory works fine.
I load, create, delete everything with my custom forms and tables.
I can't take xml or other dataprovider, because we have customers with SQL and JET Datasources.

The Problem now is, that the control makes one file to "my documents" named "memory".

Is there a possibilty to change the folder to environ$temp?




My Code to create Ressources, the file will be created after red line:

Private Function CreateRessource(ByVal m_MietobjektID As Long, ByVal m_Index As Integer, Optional ByRef m_Ressource As CalendarResource) As CalendarResource

' Deklaration
' ***********
Dim m_Schedules         As CalendarSchedules
Dim m_CC                As CalendarControl
Dim m_CCData            As CalendarDataProvider
Dim m_Weekdays          As Integer
                    
' Zuweisung
' *********
Set m_CC = Me.Kalender.Object
Set m_CCData = m_CC.DataProvider
Set m_RS = myRS("SELECT TblMietobjekt.*, TblBelegung.* FROM TblMietobjekt LEFT JOIN TblBelegung ON TblMietobjekt.MietobjektID=TblBelegung.BelegungMietobjektID WHERE MietobjektID=" & m_MietobjektID)

' Beim ersten erstellen
' *********************
If m_Ressource Is Nothing Then
  
   ' Wenn noch kein Dataprovider erstellt wurde
   ' ******************************************
   Set m_Ressource = New CalendarResource
  
   ' Wenn noch kein Dataprovider erstellt wurde
   ' ******************************************
   If m_CCData Is Nothing Then
      m_CC.SetDataProvider "Provider=memory"
      m_CC.DataProvider.Create
      Set m_CCData = m_CC.DataProvider
   End If
  
   Set m_Schedules = m_CCData.Schedules
  
   ' Neue Ressource anlegen
   ' **********************
   m_Ressource.SetDataProvider2 "memory", False
   m_Ressource.DataProvider.Create

  
   m_Ressource.Name = NE(m_RS("MietobjektKurzbezeichnung"), m_RS("MietobjektRaumzuordnung") & " " & NE(m_RS("MietobjektBezeichnung"), ""))
   m_Ressource.RetrieveDayEvents True
   m_Schedules.AddNewSchedule m_RS("MietobjektID")
   m_Ressource.ScheduleIDs.Add m_Schedules.Item(m_Index).ID
  
   ' Array mit Schedule abfüllen
   ' ***************************
   p_Schedules(m_Index, 0) = m_Schedules.Item(m_Index).ID
   p_Schedules(m_Index, 1) = m_MietobjektID
  
   m_Ressource.Name = NE(m_RS("MietobjektKurzbezeichnung"), m_RS("MietobjektRaumzuordnung") & " " & NE(m_RS("MietobjektBezeichnung"), ""))
   m_Ressource.RetrieveDayEvents True
   m_Schedules.AddNewSchedule m_RS("MietobjektID")
   m_Ressource.ScheduleIDs.Add m_Schedules.Item(m_Index).ID
Do Until m_RS.EOF
   If NE(m_RS("BelegungID"), 0) > 0 And NE(m_RS("BelegungGelöscht"), 0) = 0 Then
      Set m_Event = m_Ressource.DataProvider.CreateEventEx(m_RS("BelegungID"))
...
         m_Event.UpdateRecurrence m_Serie
      End If
      'm_Event.CreationTime = m_RS("BelegungErfasst")
      m_Ressource.DataProvider.AddEvent m_Event
      m_Ressource.DataProvider.Save
   End If
  
   m_RS.MoveNext
Loop

Set CreateRessource = m_Ressource


Pleez help me. I can't release my software. My customers will cut my head off, if there will be files like this in there "My documents"

Greez

Guru
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 16 October 2009 at 5:49pm
Change line -
 
OpenProvider cjCalendarData_Memory, "Provider=XML;Data Source=" & App.Path & "\Events.xml"
 
to use absolute path or another relative path instead of App.Path
Back to Top
guru4 View Drop Down
Newbie
Newbie


Joined: 02 October 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote guru4 Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2009 at 2:52am
Thanks mdoubson
It seams that it is not possible to work without XML in filesystem.
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2009 at 11:29am
There is no special folder assignment in MFC code like "MyDocuments", the OS puts it there as this is default for the OS.
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.