Compress Access database with Delphi

xiaoxiao2021-03-06  65

Uses DAO97, DAO2000;

procedure CompactMdbDatabase (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: = CreateComObject (dao97.CLASS_DBEngine) as _DBEngine; idbEngine.CompactDatabase (srcDbname, dstDbname, newpwd, dbVersion30, oldpwd); end else begin idbengine: = CreateComObject (dao2000.CLASS_DBEngine) as _DBEngine; idbEngine.CompactDatabase ( SRCDBNAME, DSTDBNAME, NewPWD, DBVERSION40, OLDPWD); END;

转载请注明原文地址:https://www.9cbs.com/read-118820.html

New Post(0)