Print Page | Close Window

"Provider=memory" to custom folder

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=15290
Printed Date: 18 April 2024 at 4:44pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: "Provider=memory" to custom folder
Posted By: guru4
Subject: "Provider=memory" to custom folder
Date 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



Replies:
Posted By: mdoubson
Date 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


-------------
Mark Doubson, Ph.D.


Posted By: guru4
Date Posted: 12 November 2009 at 2:52am
Thanks mdoubson
It seams that it is not possible to work without XML in filesystem.


Posted By: SuperMario
Date 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.



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