Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread OnOptimizeProgress Event
Sun, Jul 12 2009 4:45 PMPermanent Link

Marty Potokar
Reference the following code provided in the ElevateSoft Manual v4:

begin
  with MyTable do
  begin
    DatabaseName:='d:\temp';
    TableName:='customer';
    if Exists then
    OptimizeTable('',false);
  end;
end;

What code can be added to the above to indicate to an end user using my
program whether or not the Table has been successfully optimized?

Also, in using the RepairTable method programmatically, if the table to
be repaired is found to be corrupt, does DBISAM automatically generate
log messages for the repair status like that in using the utility?
Sun, Jul 12 2009 5:52 PMPermanent Link

Marty Potokar
What about coding something like this for the OptimizeTable method:

begin
    if MessageDlg('Optimize ''Clients''
Table?',mtConfirmation,[mbYes,mbNo],0)=
    mrYes then
    begin
      with dmInspectData.taClients do
      begin
        DatabaseName:='Inspect';
        TableName:='Clients';
        if Exists then
        begin
          if VerifyTable then
          begin
            try
              OptimizeTable('',False);
            finally
            ShowMessage('Table Optimization Successful');
            end;
          end
          else
            ShowMessage('Optimization Failed. Repair Table then          
Optimize');
        end
        else
        ShowMessage('Table ''Clients'' Not Found');
      end;
    end;
end;



Marty Potokar wrote:
> Reference the following code provided in the ElevateSoft Manual v4:
>
> begin
>   with MyTable do
>   begin
>     DatabaseName:='d:\temp';
>     TableName:='customer';
>     if Exists then
>     OptimizeTable('',false);
>   end;
> end;
>
> What code can be added to the above to indicate to an end user using my
> program whether or not the Table has been successfully optimized?
>
> Also, in using the RepairTable method programmatically, if the table to
> be repaired is found to be corrupt, does DBISAM automatically generate
> log messages for the repair status like that in using the utility?
Mon, Jul 13 2009 10:10 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Marty,

I would remove the try...finally because if you don't, then the message 'Table
Optimization Successful' will show up even if the OptimizeTable raises an exception.


--
Fernando Dias
[Team Elevate]
Image