Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.03.25;
Скачать: CL | DM;

Вниз

New Table   Найти похожие ветки 

 
kirill2000 ©   (2002-02-25 15:14) [0]

Скажите пожайлуста, как можно создать таблицу во время работы программы точно такую, какая уже есть, но просто с другим именем файла(другими словами скопировать структуру).


 
Fay ©   (2002-02-25 22:12) [1]

1) Узнай исходную структуру.
2) Создай таблицу с известной структурой.
3) Готово!


 
Anatoly Podgoretsky ©   (2002-02-25 22:17) [2]

Попробуй

TableName := "NewName";
CreateTable

не вовсех случаях работает.


 
sniknik ©   (2002-02-25 23:16) [3]

Пример

{
As we know, Paradox Tables consist in a table file and some corresponding index files
there are many way to copy them:
1. Using TBatchMover (at DataAccess Pallete) with Mode : BatCopy
But you can"t copy the tables corresponding index files, TBatchMove just
copies the structure and data.
2. Using FileCopy
But you can"t copy the tables corresponding index files automatically,
you should define each files
.. and many more

The Simple way is:

Put two TTables on your form, name it as tbSource and tbTarget.
Then, put this procedure under implementation area
}

type
TForm1 = class(TForm)
tbSource: TTable;
tbTarget: TTable;
// ...
end;

implementation

procedure TForm1.Button1Click(Sender: TObject);
begin
tbSource.TableName := "Source.DB"; // The name of your tables which you want to copy from
tbTarget.TableName := "Target.DB"; // The name of your tables which you will to copy to
// You Can set the tbSource.DataBaseName to an existing path/Alias
// where you store your DB
// You Can set the tbTarget.DataBaseName to an existing path/Alias
// where you want to store the duplicate DB
tbSource.StoreDefs := True;
tbTarget.StoreDefs := True;
tbSource.FieldDefs.Update;
tbSource.IndexDefs.Update;
tbTarget.FieldDefs := tbSource.FieldDefs;
tbTarget.IndexDefs := tbSource.IndexDefs;
tbTarget.CreateTable;
//Actually you can set these code up to only 5 lines :)
end;


End.



Страницы: 1 вся ветка

Текущий архив: 2002.03.25;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.008 c
1-80531
ev
2002-03-11 19:42
2002.03.25
TFileStream


1-80581
greenrul
2002-03-10 18:06
2002.03.25
Вывод текста и картинок в DrawGrid


6-80633
and_or
2002-01-09 20:26
2002.03.25
ping & tracertМожнping & tracert


6-80638
rooky in Delphi
2002-01-09 21:00
2002.03.25
IP->HostName->UserName


4-80730
dimich
2002-01-25 13:21
2002.03.25
Текущая раскладка клавиатуры