Yes You can do it under program control
Either by calling DbiDoRestructure() from the BDE.doc
unit
or (and I was surprised to discover this one day)
by putting standard SQL data definition commands
one at a time into a TQuery.sql stringlist and
calling ExecSQL
In your case something like:
query1.sql.close;
query1.sql.clear;
query1.sql.add('drop index "mytbl.db".alpha1');
query1.ExecSQL;
query1.sql.close;
query1.sql.clear;
query1.sql.add('create index alpha1 on "mytbl.db" (name2,name1)');
query1.ExecSQL;
This 2nd method probably requires a late version of the BDE
(>=5?) but the first has worked since the 16-bit Delphi days.
ns
-----Original Message-----
From: Matthew Comb <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: 04 August 2000 07:02
Subject: [DUG]: restructure table.
Hi people.
I have an application that has a paradox database table. I want to
restructure the table so that one of its indexes 'alpha1' lists via
name2,name1 instead of just name2.
Can I do this from a programming interface or do I need to use Database
Desktop?
If I can do it from a programming interface will it hold for the data that
is already in there?
Any help on this would be much appreciated!
Cheers,
Matt.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz