Hi Friends,
I stumbled across something during the software development and thought of sharing it with all of you. Many of you may have searched on ways to protect the VFP tables from being opened outside the application. At one time i searched too but with little success and than i gave up but now there is a way to protect your valueable tables from being opened outside the main VFP application.
There is no rocket science just a simple trick -
PUBLIC oApp
oApp=CREATEOBJECT('SecurityClass')
DEFINE CLASS SecurityClass AS Custom
Sale_ID=3
ENDDEFINE
CREATE TABLE 'TRANSDETAIL.DBF' NAME 'TRANSDETAIL' ;
(TRANSACTION_ID I NOT NULL, ;
PARENT_ID I NOT NULL, ;
TRANS_ID I NOT NULL, ;
MIXIN_TRANS_ID I NOT NULL, ;
MIXIN_DETAIL_ID I NOT NULL, ;
DESCRIPTION_ID I NOT NULL)
INDEX ON DESCRIPTION_ID TAG DESCRIPTION_ID FOR DESCRIPTION_ID==oApp.Sale_ID COLLATE 'MACHINE'
Now you can use the table TRANSDETAIL only when the oAPP object is available. Which will be available to the table from within your VFP Application.
Any user who tries to open the
TRANSADETAIL.DBF without the
oAPP object will get the error
Alias 'oAPP' is not found
Using the above method all of us can develop simple and secure applications without the need of 3rd party applications.
Sanjay Dhiraj Patel
MCSE, MCDBA
Net2Biz (Thailand)