Subject Re: Why object in use?
Author kimon_the_athenian2
> I think that you may be running into yourself. Creating a foreign
key
> requires that no active connection have a compiled statement that
> references either table, including the one that's creating the new
> constraint.

Thanks for the answer! The connection is made via Delphi dbExpress and
at the time of creating the FK there is a *closed* dataset that queries
from a table referenced in FK. Does a closed dbExpress dataset mean
compiled statement? But what about when it's open and all rows are
fetched?

The strangest thing is that one of my client ran this database updating
script unsuccessfully, then closed the application and started again
and then the script succeeded. At both cases there was only this closed
dataset that could reference either of FK tables.

Aivar