Subject | Re: Object in use when dropping table |
---|---|
Author | bobzirbel@yahoo.com |
Post date | 2001-07-25T04:46:55Z |
Thanks for your reply Russell.
The problem is caused by the following code:
with ReportQuery do begin (TIBOQuery, ResultLive := False)
Close;
SQL.Clear;
SQL.Add('Select * from ' + sTable);
Open;
// Report code removed
Close;
end;
There is no error if this code is removed. It's as if the 'Close' is
being ignored!
Regards
Bob
The problem is caused by the following code:
with ReportQuery do begin (TIBOQuery, ResultLive := False)
Close;
SQL.Clear;
SQL.Add('Select * from ' + sTable);
Open;
// Report code removed
Close;
end;
There is no error if this code is removed. It's as if the 'Close' is
being ignored!
Regards
Bob
--- In IBObjects@y..., "Russell Belding" <russell@b...> wrote:
> Hello Bob
>
> If, when you try to drop the temporary table, there is a
transaction open
> which uses the table then the "Table is in use". Could this be the
problem?
> Without your code I cannot fully understand your logic in steps
1...6.
>
> Regards
>
> Russell Belding
>
>
> ----- Original Message -----
> From: <bobzirbel@y...>
> To: <IBObjects@y...>
> Sent: Wednesday, July 25, 2001 2:51 PM
> Subject: [IBO] Object in use when dropping table
>
>
> > I have some code that uses TIB_grid, TIB_Query and TIBOQuery with
D5
> > and IB6.
> > The code drops and creates a temporary table, populates the table
> > from records selected in the grid, opens a simple query on the
> > temporary table and prints a report.
> >
> > All works fine - once! The second time the code is executed it
> > errors with 'Object in use' on the drop table.
> >
> > I have eliminated all extraneous code and narrowed the cause down
to
> > the last query. It's close doesn't seem to free the temporary
> > table. The sequence is as follows:
> >
> > 1. Drop table.
> > 2. Create table.
> > 3. Populate table.
> > 4. Select * from table.
> > 5. Open.
> > 6. Close.
> > 1. Drop table - error Object in use!
> >
> > If steps 4, 5 & 6 are eliminated it works fine.
> >
> > Does anyone have any idea what I doing wrong?
> >
> > Any help would be appreciated.
> >
> > Thanks and regards
> > Bob
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >