#include "fivewin.ch"
#include "Dbinfo.ch"
FUNCTION MAIN
SELECT 0
USE t090
DBINFO( DBI_PASSWORD, "12345678" )
browse()
RETURN NIL
#include "DbStruct.ch"
#include "Dbinfo.ch"
FUNCTION MAIN( cFileIn, cFileOut, cCodice )
LOCAL aStruct := {}
// open file to read to obtain structure
USE &(cFileIn) ALIAS filein
aStruct := DBSTRUCT()
USE
// create encrypted file
DBCREATE( cFileOut, aStruct )
USE &(cFileOut) ALIAS fileout
DBINFO( DBI_PASSWORD, cCodice ) // cCodice = "12345678" in example
APPEND FROM &(cFileIn)
RETURN NIL
So, if I understood it well, the user has to use a password to encrypt;
So it is not possible that by exiting the program all dbf files can be encrypted so that the user can not modify the dbf files with an external program
1. You encrypt all tables with a tool that uses the Sx_DBFencrypt (cPassword) function.
#include "Common.ch"
#include "FiveWin.ch"
PROCEDURE Main (cFileName, cPassWord)
DEFAULT cFileName TO ""
DEFAULT cPassword TO ""
IF ! EMPTY(cPassword)
IF FILE(cFileName)
USE (cFileName) VIA "DBFCDX" EXCLUSIVE
Sx_DBFencrypt (cPassword)
USE
MsgInfo("File: " + cFileName + " Encrypted")
ELSE
MsgInfo("File: " + cFileName + " NOT Found")
ELSE
MsgInfo ("Empty Passwords Not Allowed")
ENDIF
RETURN
i only want to Encrypt Name and Adress
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 89 guests