(Based on an email by Romain Strieff, dBVIPS, in the VdBASE newsgroups)
> Ya..I can easily restrict access
from within my program to check the
> security level, and restrictions can be made on a network level, but the
> users are wanting me to go the extra yard to assure that even if someone
> gains access to the file from s outside my program, that they couldn't get
> into the data file to delete or modify records, etc.
If they don't have the masterpassword,
nor the supervisor one, that's exactly what will be the result. Not even if
they steal the file and take it home. If you want that security whichout login,
that's possible as well, see the boilerplate below.
Now let's assume you entered ROBERT,MAIN,TRUSTNO1 as name, group, password
In the beginning of your program(or QBE or whatever), where you open the first of your PROTECTed tables, use the following code:
*-- make it more complicated than this so that it will not be visible when *-- _viewing_ the EXEin an Editor
Type("LockWindowUpdate") # "FP"
extern CLOGICAL LockWindowUpdate(CHANDLE) User
If Type("GetDeskTopWindow") # "FP"
extern CHANDLE GetDeskTopWindow ( CVOID ) USER
*--this will lock all windows
LockWindowUpdate(GetDeskTopWindow()) && Freeze
*--put data to type
into the login dialog in the keyboard buffer keyboard
*--this will trigger the login screen which will never appear because of
*--the locked windows and will be filled-in completely automatically
LockWindowUpdate(0) && Unfreeze the form