Print Page | Close Window

save data in visual fox how to?

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=12988
Printed Date: 02 July 2025 at 8:38pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: save data in visual fox how to?
Posted By: roka
Subject: save data in visual fox how to?
Date Posted: 20 December 2008 at 12:52pm
how could i do to save calendar data  in a table or cursor in visual fox9?



Replies:
Posted By: Auge_Ohr
Date Posted: 25 December 2008 at 2:45pm
hi,
Originally posted by roka roka wrote:

how could i do to save calendar data  in a table or cursor in visual fox9?

good Question ... i´m working with Xbase++ on same.

Information you will get from CalenderHitInfo
*** snip ***
METHOD Calender:EditCell(oHitInfo)

   CalendarViewEvent := oHitInfo:ViewEvent

   IF CalendarViewEvent == NIL
*      MSGBOX("do you want to create a new Entry ?")
      nAction := ID_FILE_NEW

   ELSE
      nAction := ID_FILE_EDIT

      CalendarEvent     := CalendarViewEvent:GetProperty("Event")
      CalendarEventRecurrenceState := CalendarEvent:GetProperty("RecurrenceState")

      DO CASE
         CASE CalendarEventRecurrenceState = xtpCalendarRecurrenceNotRecurring
         CASE CalendarEventRecurrenceState = xtpCalendarRecurrenceMaster
         CASE CalendarEventRecurrenceState = xtpCalendarRecurrenceOccurrence
         CASE CalendarEventRecurrenceState = xtpCalendarRecurrenceException
      ENDCASE

      cBody                       := CalendarEvent:Body
      cCreationTime               := CalendarEvent:treatDateAsString(.T.):GetProperty("CreationTime")
      cEndTime                    := CalendarEvent:treatDateAsString(.T.):GetProperty("EndTime")
      cLastModificationTime       := CalendarEvent:treatDateAsString(.T.):GetProperty("LastModificationTime")
      nLabel                      := CalendarEvent:Label
      cLocation                   := CalendarEvent:Location
      lMeetingFlag                := CalendarEvent:MeetingFlag
      lPrivateFlag                := CalendarEvent:PrivateFlag
      lReminder                   := CalendarEvent:Reminder
      nReminderMinutesBeforeStart := CalendarEvent:ReminderMinutesBeforeStart
      cReminderSoundFile          := CalendarEvent:ReminderSoundFile
      nScheduleID                 := CalendarEvent:ScheduleID
      cStartTime                  := CalendarEvent:treatDateAsString(.T.):GetProperty("StartTime")
      cSubject                    := CalendarEvent:Subject
      nImportance                 := CalendarEvent:Importance

      MSGBOX("Body             "+Trim(cBody)             +CRLF+;
             "CreationTime     "+cCreationTime           +CRLF+;
             "EndTime          "+cEndTime                +CRLF+;
             "LastModification "+cLastModificationTime   +CRLF+;
             "Label            "+STR(nLabel)             +CRLF+;
             "Location         "+cLocation               +CRLF+;
             "MeetingFlag      "+IF(lMeetingFlag,"Y","N")+CRLF+;
             "PrivateFlag      "+IF(lPrivateFlag,"Y","N")+CRLF+;
             "Reminder            "+IF(lReminder   ,"Y","N")+CRLF+;
             "ReminderMinutes  "+STR(nReminderMinutesBeforeStart)+CRLF+;
             "ReminderSoundFile"+cReminderSoundFile      +CRLF+;
             "ScheduleID       "+STR(nScheduleID)        +CRLF+;
             "StartTime        "+cStartTime              +CRLF+;
             "Subject          "+cSubject                +CRLF+;
             "Importance       "+STR(nImportance) )

    DoMore(oHitInfo,nAction)

*** eof ***
so far so good, BUT ...

with Xbase++ we have WorkSpaceArea for each Thread
i do open a DBF in MAIN.

*** snip ***
PROCEDURE DoMore(oHitInfo,nAction)
 
 MsgBox("Alias is "+ALIAS() )

*** eof ***
Xbase++ does say NO ALIAS(), no open DBF ... ? where is it ?

While CJ Calender is a activeX ... does CJ Calender run as seperate Thread ?
... and to :open DataProvider is use a ConnectionString ... does CJ use a own Workspace(Area) so that i can not use it together with Xbase++ DBF ?

in DataProvider there are "buildin" datalink to Access
*** snip ***
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\events.mdb"
*** eof ***
while DBF can also used by "Microsoft.Jet.OLEDB.4.0" i like to ask if someone know Syntax and Structure to use a DBF ?

have a nice Xmas





-------------
greetings by OHR
Jimmy


Posted By: Auge_Ohr
Date Posted: 02 January 2009 at 12:46am
hi,
Originally posted by roka roka wrote:

how could i do to save calendar data  in a table or cursor in visual fox9?


https://forum.codejock.com/forum_posts.asp?TID=11514&KW=GetEvent&PID=38651#38651

i found the Answer in that Thread here in Newsgroup : you have to use a DataProvider as "Custom".

*** snip ***
METHOD Calender:OpenData()
LOCAL Retvar := .T.
LOCAL cConnectionString

   USE (ZPATH+"CALENDAR.DBF") VIA "DBFNTX"
   SET INDEX TO (ZPATH+"CALDATE1.NTX")

   //
   // this is "the" String
   //
   cConnectionString := "Provider=Custom;"

   //
   // do not forget to "set" Provider
   //
   ::oCalcon:setdataProvider(cConnectionString)

   //
   // open connetion, if fail try create (do not work with DBF )
   //
   IF .NOT. ::oCalcon:DataProvider:Open()
      //
      // IMHO this does not work with "Custom" ... 16 byte is what you get
      //
      ::oCalcon:DataProvider:Create()
      Retvar := .F.
   ENDIF

   IF Retvar = .T.
      //
      // fill Calender with all Records
      //
      ::DoFromDBF("ALLRECORD")
   ENDIF

RETURN Retvar
*** eof ***
now also "Problem" of "lost" ALIAS() are gone and you can use all DoXXXX Method (search in help for "DoXXXX").

for more Information you may want to join XCodeJock Project.
it will use Xbase++ and Express++ but Source Code as "native" Xbase++ is also include.
we want to write "Wrapper" for almost all CodeJock OCX and did most allready

hope it is allowed to post URL ? i do it (not my Site):
http://www.donnay-software.com/

greetings by OHR
Jimmy




-------------
greetings by OHR
Jimmy



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