Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to locate data within Resource Files

Status
Not open for further replies.

MForrest

Programmer
Jun 9, 2003
85
GB
Hi all need a bit of guidance on this one.

I need to create a calendar/diary without using outlook or buying in a product. I have used the activex calendar control and believe all entries in the FoxPro calendar/diary tool are saved in the active resource file (FOXUSER.DBF by default), one record per date. What I require is to create appointments for different time schedules within each day, therefore needing to create multiple records per date. What I have done so far is used text and edit boxes for the user to enter the start time, duration of an appointment and appointment details to which I have produced a table to append and store each appointment to. The user can then select a date from the calendar (in theory) and all appointments made will be accesible in a grid. I am having problems trying to access which date the user has selected, I tried SET RESOURCE ON to try and locate the date but dont know how to retrieve this from the resource file.

If anyone has any ideas to make my life easier then please feel free to drop me a line. Cheers
 
activex calendar control and believe all entries in the FoxPro calendar/diary tool are saved in the active resource file (FOXUSER.DBF by default),

The calendar used by this:
ACTIVATE WINDOW calendar

Is not an activex, but rather a very old leftover from older versions of FoxPro, and does not have anyway to detect the click event. You may consider the use of an actual activex like Microfsoft Calendar.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
If you use ACTIVATE WINDOW calendar, which like Mike said is the calendar used since way back when, the data you type in the 'diary' section of the calendar is indeed stored in the FOXUSER.DBF (resource file).
The easiest way to get at that data is something like this:
Code:
SELECT * FROM Sys(2005) ;
   INTO CURSOR MyResource ;
   WHERE id = 'DIARYDATA'

This is how the records are written:
[ul]
[li]The system variable _DIARYDATE is the date which was last selected by the user within the calendar.
[/li]
[li]When text is entered in the diary side of the calendar, a new record is created for that date.
[/li]
[li]The 'Name' memo field of the record is replaced with _DIARYDATE. [/li]
[li]The 'Data' memo field is replaced with the text entered for that date.[/li]
[/ul]

Now that calendar isn't very useful for what it is you're trying to do, but I thought I would try to help you see how it ticked anyway.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top