如何動態為 DB檔加入密碼? |
缺席
|
P.D.
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
|
P.D.
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
|
leee02
一般會員 ![]() ![]() 發表:17 回覆:12 積分:5 註冊:2002-10-09 發送簡訊給我 |
引言:引言: 請問各位! 有沒有人有經驗以程式碼將Paradox DB檔加入 Password Securaity 模式中 我現在都是以 DataBase DeskTop 所提供的功能來做!我今天瀏覽之前提出的討論問題, 檢查到本封沒有結案, 本案已有解決之法, 並封包成 xtable 元件早先已放在本站中! -------------------------------------------------------- 利用這個程序試試看。 procedure EncryptPDOXTable(TableName, Password : String); var TblDesc: CRTblDesc; LocDB : TDatabase; begin //Initialize the BDE Check(DBIInit(nil)); //Initialize random number generator Randomize; //Create a local, non-owned database object that //points to the path associated with the table. LocDB := TDatabase.Create(nil); with LocDB do begin Params.Add('path=' ExtractFilePath(TableName)); DatabaseName := 'PDOXEncryptDB' IntToStr(Random(50)); DriverName := 'STANDARD'; Connected := True; end; //Now, initialize the Table Descriptor with the values //required to set a master password. FillChar(TblDesc, SizeOf(CRTblDesc), 0); StrPCopy(TblDesc.szTblName, ExtractFileName(TableName)); with TblDesc do begin bProtected := True; StrPCopy(TblDesc.szPassword, Password); end; //Now do the restructure. try Check(DbiDoRestructure(LocDB.Handle, 1, @TblDesc, nil, nil, nil, False)); finally LocDB.Free; DBIExit; end; end; |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |