Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Backup: Get List of ALL Tables
Thu, Oct 4 2007 12:18 PMPermanent Link

alexu
I want to implement backup procedure into my application. It appears that Backup() method
requires list of table names. What is the easiest way to get list of tables from a given
database? Passing nil does not work.

Same with restore - if I want to restore all tables from backup - how do I do that?

Thank you

Alex
Thu, Oct 4 2007 12:49 PMPermanent Link

Michael Fullerton
On Thu, 4 Oct 2007 12:18:09 -0500, alexu <alex@zfirmllc.com> wrote:

>I want to implement backup procedure into my application. It appears that Backup() method
>requires list of table names. What is the easiest way to get list of tables from a given
>database? Passing nil does not work.

Provided each table has a TDBISAMTable component in a Datamodule, you
could cycle though each component of the DataModule adding only the
table names into a TStrings. Something like this:

 for i:= 0 to DM.ComponentCount-1 do
   if (DM.Components[i] is TDBISAMTable) then
     lbTables.Items.Add(TDBISAMTable(DM.Components[i]).TableName);

>Same with restore - if I want to restore all tables from backup - how do I do that?
>
>Thank you
>
>Alex
Thu, Oct 4 2007 1:10 PMPermanent Link

alexu
Michael Fullerton <fullerm@spamkiller-remove-cybermatrix.com> wrote:

>Provided each table has a TDBISAMTable component in a Datamodule, you
>could cycle though each component of the DataModule adding only the

thank you for suggestion but I use TQuery, so I do not have TTable component for each table...
Thu, Oct 4 2007 1:13 PMPermanent Link

Eryk Bottomley
alexu,

> I want to implement backup procedure into my application. It appears that Backup() method
> requires list of table names. What is the easiest way to get list of tables from a given
> database? Passing nil does not work.

Session.GetTableNames

> Same with restore - if I want to restore all tables from backup - how do I do that?

Database.BackUpInfo

Eryk
Thu, Oct 4 2007 5:42 PMPermanent Link

alexu
Thank you. GetTableNames worked! Have not tested restore yet Smile
Thu, Oct 11 2007 2:48 PMPermanent Link

Jon Lloyd Duerdoth
I think something like

   session.GetTableNames(gDatabaseName, lStr);

might be what you want.

JonD

alexu wrote:
> I want to implement backup procedure into my application. It appears that Backup() method
> requires list of table names. What is the easiest way to get list of tables from a given
> database? Passing nil does not work.
>
> Same with restore - if I want to restore all tables from backup - how do I do that?
>
> Thank you
>
> Alex
>
Image