> All tables are inactive at the time the table in question is to be
> cloned. When the table component connected to the clone table is open at
> design-time the error message "Table is busy" is generated. When the
> table is closed at design-time there is not problem at all.
You anwered it yourself, Design time is another environment than your program. Your
program runs in its own memory space with its own access to tables. The design time
tables are still active, but from within the Delphi IDE, and not your application.
Now if you leave the design time tables open and run your program then you both have
the tables open.
Chris
Christopher Crowe (Software Developer)
Microsoft MVP, MCP
Adrock Software
Byte Computer & Software LTD
P.O Box 13-155
Christchurch
New Zealand
Phone/Fax (NZ) 03-3651-112
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of John Christenhusz
> Sent: Thursday, 8 April 1999 09:02
> To: Multiple recipients of list delphi
> Subject: [DUG]: Table busy
>
>
> Hi all,
>
> I've got the following problem:
> I create a copy table, using the following code
> with tblSource do
> begin
> databaseName := sDBaseName;
> tableName := sSourceTableName;
> end;
>
> with tblDest do
> begin
> databaseName := sDbaseName;
> tableName := sDestTableName;
> end;
>
> with tblDest do
> try
> tblSource.fieldDefs.update;
> fieldDefs.assign(tblSource.fieldDefs);
> tblSource.IndexDefs.update;
> indexDefs.assign(tblSource.indexDefs);
> createTable; // create clone table
>
> This works fine, unless I leave the destination table (component) open
> at design time. No hold on, I do shut all the tables at OnCreate() by
> the following code:
> // close all tables
> for i := 0 to componentCount-1 do
> begin
> try
> if components[i] is TTable then
> with TTable(components[i]) do
> begin
> close;
> dataBaseName := sMainDbaseName;
> end;
>
> Summarised:
> All tables are inactive at the time the table in question is to be
> cloned. When the table component connected to the clone table is open at
> design-time the error message "Table is busy" is generated. When the
> table is closed at design-time there is not problem at all.
>
> Any ideas?
>
> TIA
>
> John Christenhusz
> POSTEC DATA SYSTEMS Ltd.
> PO Box 302-230
> Auckland, New Zealand
> E-mail: [EMAIL PROTECTED]
> Phone: 09-415.8803
> Fax: 09-415.9042
>
>
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz