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

Вниз

Создание dbf   Найти похожие ветки 

 
Tor   (2004-11-22 16:25) [0]

Немог бы кто нибудь привести пример кода создания dbf руками
(FoxPro 2.6)
Благодарю!


 
Anatoly Podgoretsky ©   (2004-11-22 16:34) [1]

В справке есть примеры создания.


 
Tor   (2004-11-22 16:40) [2]

может я че то не дапонял?
используя структуру dbf файла


 
Карелин Артем ©   (2004-11-22 17:09) [3]

Builds a new table using new structure information.

procedure CreateTable;

Description

Call CreateTable at runtime to create a table using this dataset’s current definitions. If the table already exists, CreateTable overwrites the table’s structure and data. To avoid overwriting an existing table, check the Exists property before calling CreateTable.

If the FieldDefs property contains values, these values are used to create field definitions. Otherwise the Fields property is used. One or both of these properties must contain values in order to create a database table.

If the IndexDefs property contain values, these values are used to create indexes on the table.
The following example shows how to create a table.

{ Don"t overwrite an existing table }

if not Table1.Exists then begin
 with Table1 do begin
   { The Table component must not be active }
   Active := False;  
   { First, describe the type of table and give }
   { it a name }
   DatabaseName := "DBDEMOS";
   TableType := ttParadox;
   TableName := "CustInfo";
   { Next, describe the fields in the table }
   with FieldDefs do begin
     Clear;
     with AddFieldDef do begin

       Name := "Field1";
       DataType := ftInteger;
       Required := True;
     end;
     with AddFieldDef do begin
       Name := "Field2";
       DataType := ftString;
       Size := 30;
     end;
   end;
   { Next, describe any indexes }
   with IndexDefs do begin
     Clear;
     { The 1st index has no name because it is
     { a Paradox primary key }
     with AddIndexDef do begin

       Name := "";
       Fields := "Field1";
       Options := [ixPrimary];
     end;
     with AddIndexDef do begin
       Name := "Fld2Indx";
       Fields := "Field2";
       Options := [ixCaseInsensitive];
     end;
   end;
   { Call the CreateTable method to create the table }
   CreateTable;
 end;
end;


 
Tor   (2004-11-22 18:03) [4]

Интересно а зачем тогда в структура dbf-ника расписана по байтам?
:)



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

Форум: "Базы";
Текущий архив: 2004.12.19;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.041 c
14-1101512945
e-mike
2004-11-27 02:49
2004.12.19
каталог m3


8-1095439667
Рыба
2004-09-17 20:47
2004.12.19
ScanLine и RGB


1-1102123621
Bobby Digital
2004-12-04 04:27
2004.12.19
Cursor


3-1100675438
Дырчик
2004-11-17 10:10
2004.12.19
Поле типа дата


14-1101932119
Verg
2004-12-01 23:15
2004.12.19
А в чем сила?





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский