"Provider=memory" to custom folder |
Post Reply |
Author | |
guru4
Newbie Joined: 02 October 2009 Status: Offline Points: 6 |
Post Options
Thanks(0)
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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
|
|
guru4
Newbie Joined: 02 October 2009 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Thanks mdoubson
It seams that it is not possible to work without XML in filesystem. |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
There is no special folder assignment in MFC code like "MyDocuments", the OS puts it there as this is default for the OS.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |