>I have run into issues with a VFP 9 app that we have that has been upgrade from VFP 6 to VFP 9 SP1 with getting periodic "memo file is missing or invalid" error message #41 on lines of code that have "set resource to ("C:\Documents and Settings\UserName\Local Settings\Application Data\Company\Product\myprefscustomfilename.dbf"). I understand from reading that VFP 9 changed things in that it uses the resource file (otherwise known as foxuser.dbf but I use a custom name for it in the app) SHARED instead of EXCLUSIVE as it did in versions before VFP9. Whenever I want to change the data in the file in the app (since I store some data in the prefs for the custom program)
>so I always use this code to update the data
>
>set resource off
>use ("C:\Documents and Settings\UserName\Local Settings\Application Data\Company\Product\myprefscustomfilename.dbf") in 0 shared alias myprefs
>set resource to ("C:\Documents and Settings\UserName\Local Settings\Application Data\Company\Product\myprefscustomfilename.dbf")
>
>any ideas on why I'm getting this and ideas on how to avoid this issue? As far as I know I've looked and the file is NOT open in any workarea when it says the error
Well, first, I have to ask the obvious question, does the .FPT file exist in the same folder as its corresponding .DBF?
Are both files marked NOT as read-only? If you're running from an .EXE, is there a table with the same name built-in to the .EXE?
I seem to recall there may be some structural differences between VFP6 and VFP9 resource files. One thing you could try is
- make a copy of a known good VFP9 resource dbf/fpt
- ZAP the copy
- APPEND from the VFP6 resource file to the empty VFP9 one. Then test with that
Maybe there is some corruption in the .FPT: you could check for bad characters e.g. null characters (CHR( 0 )) in memo field(s)
If none of the above helps, can you explain further why you're opening the resource file as a table prior to SETting RESOURCE TO in?
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up