More strange is that some computer can. I use win2003 how make normal. A virtual machine with XP/Windows 7: normal. But I pretended to the original system.
start or exit compression software this I know.
But in the process of software running because of software function can't operate compression.
, there is no good way to??
.
CodePudding user response:
Tools have a compression and repair the database options, should be able to reduce your file size, not affect the content,CodePudding user response:
USES Sysutils ComObj, Dialogs.
Function DaoActive (var DaoObject: OleVariant) : Boolean;
The function DaoCompactDB (const FileName, Pwd: string) : Boolean;
The function DaoRepairDB (const FileName: string) : Boolean;
Implementation
Function DaoActive (var DaoObject: OleVariant) : Boolean;
The begin
Result:=False;
Try
DaoObject:=GetActiveOleObject (' DAO. DBEngine. 36 ');
Result:=True;
Except,
Try
DaoObject:=CreateOleObject (' DAO. DBEngine. 36 ');
Result:=True;
Except,
DaoObject:=Null;
end;
end;
end;
//compression Access database
The function DaoCompactDB (const FileName, Pwd: string) : Boolean;
Var
Db: OleVariant;
TempFile as expected: the string;
The begin
Result:=False;
Try
If not DaoActive (db) then
The Exit;
Try
TempFile as expected:=ExtractFilePath (FileName) + 'msaTemp. MDB';
Db.Com pactDatabase (FileName, TempFile as expected,,, '; The PWD='+ PWD);
The DeleteFile (FileName);
RenameFile (TempFile as expected, the FileName);
Result:=True;
Except,
On E: EOleException do
ShowMessage (E.M essage);
End
The finally
Db:=the Unassigned;
end;
end;
//repair Access database
The function DaoRepairDB (const FileName: string) : Boolean;
Var
Db: OleVariant;
The begin
Result:=False;
Try
If not DaoActive (db) then
The Exit;
Try
Db. RepairDatabase (FileName);
Result:=True;
Except,
On E: EOleException do
ShowMessage (E.M essage);
End
The finally
Db:=the Unassigned;
end;
end;
Should check the DAO in DaoActive version, generality was strongest
CodePudding user response:
Compression code is. When I started the program under compression.But in the process of the program is run bigger is no way out.
want to find out the cause of the explosion is what??
CodePudding user response:
Consider using an in-memory database frequently, speaking, reading and writing, and exit the program to write againCodePudding user response:
Access to this function?CodePudding user response: