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

How I can lock open dbf files from excel?

Status
Not open for further replies.

OXIGEN

Programmer
Mar 12, 2002
11
0
0
PY
How I can lock a table for not access it from excel?. The table only may be accesed from my aplication.

Regards.
 
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.

Rick
 
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.

Good Luck,
jrbbldr
jrbbldr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top