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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar: Foxuser resource file is unavaiable ? 2

Status
Not open for further replies.

pxw

Programmer
Jan 6, 2002
86
AU
When running the following codes,
Activate window Calendar
I got an error message,
"Foxuser resource file is unavaiable. Diary disabled".

Note that the calendar still appears on the screen after the error message. However, it doesn't work.

Any help would be appreciated.


Peter
 
the diary uses the foxuser.dbf file to store info. Make sure it exist. Attitude is Everything
 
hi danceman,

Thanks. The foxuser.dbf does exit. I can open it in the VFP command window. It is in the default path. However, I still get the same error message.

Peter

 
for some reason the file is not available, maybe something has it open exclusive. Attitude is Everything
 
Hi danceman,
I found why the file is not available. This is becasue the resource file is setted to "no used" in the section of file locations of Options in my VFP system. The Calendar/Diary work okay now.

By the way, I can not find the thread Q104884, which you memtioned in thread184-315844. I am interested in how to write to the Calendar/Diary Programmatically. I appreciate if you can let me know how to find more formation regarding this isssue.


Peter






 
You may want to consider using the Date/Time picker ActiveX control instead of the calendar/diary or even writing your own. You can maintain a table for diary entries and use the DT Picker for the interface.

Dave S.
 
pxw

A couple of suggestions.
1. Create a separate foxuser.dbf (use can name differently if you wish), and put it in the application folder (to keep things neat) and use the:
SET RESOURCE TO c:\myApp\foxuser.dbf && Or what ever name you chose.

2. Since the foxuser is a regular table, you can easily write to it like any other table. In order to determine what fields are required and what info is required to input data in the calendar. Just do the step above and zap the table, go to VFP and SET RESOURCE TO and, start the calendar and make one entry. Close the calendar, and open the resource file and look for an entry in the ID field "DIARYDATA" and check the other fields on that record.

 
Or, you can:

USE FoxUser AGAIN ALIAS TmpDiary
BROWSE FOR id = 'DIARYDATA'
-or-
COPY TO Diary FOR id = 'DIARYDATA'

Dave S.
 
Very interesting Dave, since FoxPro opens the file "exclusive" so two people can't use the same resource file (unless it's marked readonly), it's amazing that this code does seem to work. Note: I used -
USE (sys(2005)) AGAIN ALIAS TmpDiary
just so I didn't have to worry if the resource file name was other than FoxUser.DBF. (This value of course can be intially overridden by an entry in the CONFIG.FPW file!)

Rick
 
Rick,

It is most interesting. What's even more interesting is this:

USE FoxUser AGAIN ALIAS TmpDiary EXCLUSIVE
SELECT 0
USE FoxUser AGAIN ALIAS TmpDiary2 SHARED

Evidently, VPF ignores SHARED.

Dave S.
 
Let me add, I see this happening with any table opened exclusively by the current VFP session, then USEd again in the same session.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top