Board index » delphi » TTable Open() problem

TTable Open() problem

I'm using BCB 4 and calling TTable::Open() and then checking the
'Active' property.

SNIP--------------------
         if (SourceTables->Exists)
         {
            FSourceTable->Open();
         }
         if (FSourceTable->Active)
         {...
SNIP--------------------

The 'Active' property is false but Open() does not throw an exception.
I thought that Open() would throw an exception if it failed.  How do I
check to see why the table did not open?

Using: BCB4, BDE, Paradox table level 7, and TSesion<-TDatebase<-TTable.

Thanks in advance to anyone with help.

 

Re:TTable Open() problem


Hi Pierce,

The TDataset Open() doesn't raise any exception if it cannot
open the underlying table.
So you should wrap all further access to the Table in a Try/Catch
block in order to track the error and/or check the Active property to see it the Table is really opened.

HTH
Antonio

Other Threads