Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  151

•  TDictionary Custom Sort  3 331

•  Fast Watermark Sources  3 081

•  3D Designer  4 840

•  Sik Screen Capture  3 334

•  Patch Maker  3 547

•  Айболит (remote control)  3 652

•  ListBox Drag & Drop  3 007

•  Доска для игры Реверси  81 659

•  Графические эффекты  3 936

•  Рисование по маске  3 242

•  Перетаскивание изображений  2 622

•  Canvas Drawing  2 745

•  Рисование Луны  2 573

•  Поворот изображения  2 180

•  Рисование стержней  2 168

•  Paint on Shape  1 568

•  Генератор кроссвордов  2 233

•  Головоломка Paletto  1 767

•  Теорема Монжа об окружностях  2 224

•  Пазл Numbrix  1 685

•  Заборы и коммивояжеры  2 056

•  Игра HIP  1 281

•  Игра Go (Го)  1 228

•  Симулятор лифта  1 473

•  Программа укладки плитки  1 216

•  Генератор лабиринта  1 546

•  Проверка числового ввода  1 363

•  HEX View  1 496

•  Физический маятник  1 358

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Как скопировать структуру таблицы



{
  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.







Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте