Other than putting it somewhere on a file server that can't be accessed directly by users, there is nothing you can do to prevent it from being opened.
There are techniques - own code and 3rd party solutions - that would allow you to encrypt fields, the entire record, or the entire file. They might still be able to open it, but they would be able to "correctly" update it and would be able to "read" what was encrypted.
There are a number of ways to stop Excel access to your data table. Unfortunately none of them are what I would call a "clean" answer.
1. If you have your data table Open and have it set FLOCK(), then Excel will not be able to open it. Unfortunately other Foxpro application users will not be able to open it either.
2. You could rename your data table to have an unusual extension such as ThisTabl.FPW or ThatTabl.COM With an unusual extension, then Excel would not see it as an eligible file to open and other users might not be tempted to look at it. When you wanted to use the file within Foxpro, you would have to explicitly define the name with its unusual extension so that Foxpro would attempt to open it.
3. You could set the file attributes for the data table on closing the table and re-set them on opening it. If you set the file attributes to Hidden and/or System after closing the table, then Excel would not "see" the file. You would need to re-set them to Non-Hidden and/or Non-System when you launched your application so that Foxpro could use it.
Perhaps other people might have some other good answers for you too.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.