Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to rename / delete existing Paradox tables

Status
Not open for further replies.

RtWee

Technical User
Dec 16, 2002
19
NL
Hi

Question:
I've got paradox tables with indexes and secondairy indexes, in other words not just the *.db file. I would like to rename and possibly delete the table, not just the *.db file, but the whole lot. How do I do that ?

Greetz

Rene
 
Use a query against your database and use SQL statement DROP TABLE....




//Nordlund
 
hi

I think you'll have to drop any constraints and indexes first, if you have any.

lou

 
I did a test with indexes, and when I dropped da table, the index files also was removed...


//Nordlund
 
looks like useful tips, but I haven't used queries nor SQl-statements before, so this is not enough information for me to put it in practice. Is there any other way withoud the use of queries to rename / delete tables ?
 
You may think that SQL and Query type components a bit scary at first but they are well worth the effort in mastering.

Eventually, you should find them easier and more powerful than using TTable type components.

As an example, this is how you could use TQuery to drop the Paradox table (indexes and all). This procedure, DropTable takes the name of the database containing the table and the name of the table as parameters.
Code:
procedure DropTable ( const dbname, table: string );
begin
  with TQuery.Create (nil) do try
    DatabaseName := dbname;
    SQL.Add ( 'DROP TABLE ' + table );
    ExecSQL;
  finally
    free;
  end;
end;

I haven't tested the above code so there may be some typos.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top