Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Базы";
Текущий архив: 2002.03.25;
Скачать: [xml.tar.bz2];

Вниз

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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.004 c
3-80455
Font Hunter
2002-02-25 15:06
2002.03.25
Физическое имя поля


3-80417
Malder
2002-02-25 22:13
2002.03.25
Раздача привелегий юзерам


1-80585
KvORubin
2002-03-08 15:10
2002.03.25
Как мне вставить свой курсор в форму !!!!


4-80717
Dimich
2002-01-25 14:32
2002.03.25
Как можно получить текущую раскладку клавы


14-80675
Чужая
2002-02-11 06:10
2002.03.25
О мужском поле





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский