用Delphi 壓縮Access資料庫

2021-03-31 08:56:29 字數 678 閱讀 3526

uses dao97,dao2000;

procedure ***pac***bdatabase(srcdbname,dstdbname,oldpwd,newpwd:string;baccess97:boolean=true);

var idbengine:_dbengine;

begin

if oldpwd <>'' then oldpwd := ';pwd='+oldpwd;

if newpwd <>'' then newpwd := ';pwd='+newpwd;

if baccess97 then

begin

idbengine := create***object(dao97.class_dbengine) as _dbengine;

idbengine.***pactdatabase(srcdbname,dstdbname,newpwd,dbversion30,oldpwd);

end else

begin

idbengine := create***object(dao2000.class_dbengine) as _dbengine;

idbengine.***pactdatabase(srcdbname,dstdbname,newpwd,dbversion40,oldpwd);

end;

end;

Delphi 壓縮Access資料庫

由於access資料庫在反覆使用過程中會自動增大,delphi壓縮access資料庫的簡單方法如下 首先要引用comobj單元 function tform1.compac b const dbfile,pwd string boolean var tempdbfile string constr ...

Delphi對Access檔案加密

下面的過程不會提示不認識資料庫,只是會提示密碼錯誤,任何讀取密碼的軟體都不能讀出正確的密碼 function lockupfile filename string lock boolean true integer 加密 解密資料庫,針對 access 2000 var f file bf arra...

Delphi連線ACCESS的方法

delphi 連線access 的方法 一 tadoconnection connmain 為tadoconnection tadoconnection主要作用是連線資料庫 connectionstring 連線資料庫 connected 設為true keepconnection 設為true l...

用C 壓縮和修復Access資料庫

介紹 下面這段c 可以 用來壓縮和修復access資料庫,不管它是一個簡單的 mdb 還是一個 mdw 網路共享資料庫,這個過程和你在用ms access應用程式中使用的 工具 資料庫實用工具 壓縮和修復 時執行的操作完全一樣.例項 使用了 遲繫結 執行中在記憶體中建立com物件 這樣就不需要在工程...

壓縮access資料庫

遇到一個問題,使用的是accesss資料庫,在載入資料庫中的資訊的時候,速度特別慢,有時候一次查詢最終會卡15秒左右,然後才能得到結果,跟蹤發現卡的地方在sqlexecdirect中,已經是odbc api了。開啟資料庫看也沒發現啥問題,後來點了access上邊的 壓縮和修復資料庫 工具,資料庫從原...