Board index » delphi » "Closed Dataset" Messages

"Closed Dataset" Messages

I'm experiencing a problem for wich I can't quite figure out a
reason. The situation is as follows:

I've got a TTable called DEFECTS.DB, which contains records
relating to safety inspections. Another TTable, CODES.DB, which
contains descriptive text and penalty point values for those
Defects. When I run the application, I get a Database Exception
indicating that the CODES dataset is closed. The Active
property for the TTable is set to True, and another lookup-type
table on the same form doesn't display this behavior.

If I explicitly (re)set the Active property to True in the
DEFECT table's CalcFields procedure (where I'm calculating a
CodeDescription field from CODES.DB), the program works. Why do
I have to do this even though the Active property is True for
the CODES table?

Some further information from additional testing:

The problem occurs only on the CODES.DB. I've recreated all of
the tables, just to make sure. Also, it occurs in the DEFECT
table's CalcFields method. Another table used in the same way,
shows as Active in the same procedure. Also, I created a
simpler form with just the DEFECT and CODES .DBs in it, with
the same error. Setting the Active property to True in the
CalcFields method works, but I'd like to know why I have to do
so, since the visible properties wouldn't seem to indicate that
I would.

Any help will be appreciated. Thanks in advance,

H.B. Taylor

 

Re:"Closed Dataset" Messages


Quote
H.B. Taylor (hbtay...@smartnet.net) wrote:

[snip]
: If I explicitly (re)set the Active property to True in the
: DEFECT table's CalcFields procedure (where I'm calculating a
: CodeDescription field from CODES.DB), the program works. Why do
: I have to do this even though the Active property is True for
: the CODES table?

I don't know what is going on, but make sure nothing in your code closes the
table.

Wilhelm

Other Threads