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!

DBF Security 1

Status
Not open for further replies.

acerrudo

Programmer
Nov 4, 2002
12
0
0
PH
Hi,

How can I prevent users from opening my applications DBF files in Excel or other programs. I am using Clipper S'87.

In the past I used a function that change the dbf header to prevent user's from opening it outside the application. This is a very old technique. Any new one?




 
The best way remains as you say to modify a byte or two in the header of the table - so that the other programs don't like reading it.

No short cuts on this one.

Tip: If you do modify a byte or two, place a marker file in the same folder to let yourself know later - and remove it while you have the table open. That way you can test for it should your porgram crash.

Regards

Griff
Keep [Smile]ing
 
Another tip is to replace clipper read & write methods to encrypt/decrypt data on runtime .. it is a litle slow thought, but it is much safer.

Regards


 
Any encrypt/decrypt function you can share. I think this will do. Thanks
 
Get CLIPX, a library that has the functions encrypt() and desencrypt(), which en/de-crypts strings.
for encrypting numbers you can easily write some en/de-crypt routines yourself.

Rob.
 
An example on how to encrypt strings:

function EncrStr
parameter StrIn
StrOut=''
for _x=1 to len(StrIn)
StrOut=StrOut+chr(asc(substr(StrIn,_x,1))+15+_x)
next
return StrOut

function DecrStr
parameter StrIn
StrOut=''
for _x=1 to len(StrIn)
StrOut=StrOut+chr(asc(substr(StrIn,_x,1))-(15+_x))
next
return StrOut

Rob.
 
Thanks you very much for all the help I have received.

Allan
 
Rename the file-extension to something Excel doesn't automatically recognize as beeing readable, like MYDATA.DDD and when opening the file just specify the full name.
Code:
...
use "MYDATA.DDD" shared
...

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top