Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 14 of 14 total
Thread D3.3 ForceClose?
Thu, Jan 21 2010 5:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< Ok, I found Typed operators option, I disable this, and I can compile the
source. >>

You can find the compilation options for DBISAM here, for future reference:

http://www.elevatesoft.com/manual?action=mantopic&id=dbisam4&product=d&version=7&category=2&topic=12

<< Possible the problem with DBISAMTable that first you do the "Destroying",
and After the Close.

In DB.Pas you can see that before close not running on destroy!!!

       if not (csDestroying in ComponentState) then DoBeforeClose; ////
THIS IS
       SetState(dsInactive);
       CloseCursor;
       if not (csDestroying in ComponentState) then DoAfterClose; //// AND
THIS

This causing that the Table Bef/Aft. Close not handled. >>

Yep, you're right - Borland coded it so that these events aren't called
during a Free.  The workaround would be to implement this in a descendant
component's .Destroy method that overrides the base Destroy methods and
calls Close *before* calling the inherited Destroy method.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jan 22 2010 4:22 AMPermanent Link

"Eduardo [HPro]"
Tim

I would add the following code:

destructor TMyDBISamTable.Destroy(Sender: TObject);
begin
   Close;
    try
       if (UpperCase(DataBaseName) = 'MEMORY') and Exists then begin
          DeleteTable;
       end;
    except
    end;
    inherited;
end;

Eduardo

Fri, Jan 22 2010 6:15 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eduardo,

<<  I would add the following code: >>

Maybe for your implementation, but I wouldn't want it in every case since it
would prevent someone from using an in-memory table across several
opens/closes like a regular table.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jan 25 2010 4:22 AMPermanent Link

"Eduardo [HPro]"
Tim

I understand your point. Like you said, maybe in my code because I only use
memory tables for each form.

Eduardo

« Previous PagePage 2 of 2
Jump to Page:  1 2
Image