Board index » delphi » TTable.DeleteTable does not work

TTable.DeleteTable does not work

I am using Delphi 1.0 on Windows for Workgroups 3.11

How come the DeleteTable() method of TTable does not delete the DB file?
I am creating a temporary table dynamically at run-time and I want to
delete the file when I am finished with it. The CreateTable() method
creates the file but I have to use the DeleteFile() function to delete
it. Is this a bug or the way that the function is supposed to work?

Helge

 

Re:TTable.DeleteTable does not work


Quote
Helge Bredow wrote:

> I am using Delphi 1.0 on Windows for Workgroups 3.11

> How come the DeleteTable() method of TTable does not delete the DB file?
> I am creating a temporary table dynamically at run-time and I want to
> delete the file when I am finished with it. The CreateTable() method
> creates the file but I have to use the DeleteFile() function to delete
> it. Is this a bug or the way that the function is supposed to work?

> Helge

Here is an example of using the Table Delete function . . .Works like a
champ for us:

                with Table1 do {Loop through and Delete all the Temp Tables}
                begin
                        Active := False;
                        if x = 6 then
                                DatabaseName := Session.PrivateDir
                        else
                                DataBaseName := TheAlias;  {TheAlias is defined previously}
                        TableType := ttParadox;
                        case x of
                                1: TableName := 'G_IWSM';
                                2: TableName := 'G_TEMP';
                                3: TableName := 'C_IWSM';
                                4: TableName := 'C_TEMP';
                                5: TableName := 'IWSMCNTR';
                                6: TableName := 'DELPRGRP';
                        end; {case}
                DeleteTable;
                end; {with Table1}

Keys to remember, Make the Active property := False and you must also
Set the TableType.

  Ted Herrlich
--

"The Pen is Mightier than the Sword, unless you are One on One."

Re:TTable.DeleteTable does not work


In article <327E4C48.5...@notes.dola.wa.gov.au>,

Quote
Helge Bredow <helge_bredow.d...@notes.dola.wa.gov.au> wrote:
>I am using Delphi 1.0 on Windows for Workgroups 3.11

>How come the DeleteTable() method of TTable does not delete the DB file?
>I am creating a temporary table dynamically at run-time and I want to
>delete the file when I am finished with it. The CreateTable() method
>creates the file but I have to use the DeleteFile() function to delete
>it. Is this a bug or the way that the function is supposed to work?

It works in my program. Have you closed the table? You can't delete a table
that is open.

--
CUL8R dude!                       \|/
                                  @ @
Jens  +-----------------------oOO-(_)-OOo-----------------------+
      | Internet   jb...@image.dk     CompuServe    100437,2475 |
      | FidoNet         2:235/142     VirNet          9:451/238 |
      | OS2Net          81:445/49     Fax     +45 - 3537 - 7006 |
      +---------------------------------------------------------+

Other Threads