procedure tform1.make_table;
var
imtable : ttable;
begin
imtable := ttable.Create(application);
imtable.DatabaseName := 'infofarm';
imtable.TableName := ed5.Text;
imtable.TableType := ttparadox;
imtable.FieldDefs.Clear;
imtable.FieldDefs.Add('key', ftfloat,0, true);
imtable.FieldDefs.Add('name', ftstring, 30, false);
imtable.IndexDefs.Clear;
imtable.IndexDefs.Add('', 'key', [ixPrimary]);
imtable.IndexDefs.Clear;
imtable.CreateTable;
imtable.Open;
end;
하면 인벨류드 파라미터 에러가 납니다!!
왜일까요?
유니크가 있어도 그런 현상이 나는데,,,
procedure CreateATable(DBName, //Alias or path
TblName : String); //Table Name to Create
TblType : TTableType); //ttDefault, ttParadox, ttDBase, ttASCII
var
tbl : TTable;
begin
tbl := TTable.Create(Application);
with tbl do begin
Active := False;
DatabaseName := DBName;
TableName := TblName;
TableType := TblType;
with FieldDefs do begin
Clear;
Add('LastName', ftString, 30, False);
Add('FirstName', ftString, 30, False);
Add('Address1', ftString, 40, False);
Add('Address2', ftString, 40, False);
Add('City', ftString, 30, False);
Add('ST', ftString, 2, False);
Add('Zip', ftString, 10, False);
end;
{Add a Primary Key to the table}
with IndexDefs do begin
Clear;
Add('Field1Index', 'LastName;FirstName', [ixPrimary, ixUnique]);
end;
CreateTable; {Make the table}
end;
end;
졸다졸다 wrote:
> procedure tform1.make_table;
> var
> imtable : ttable;
> begin
> imtable := ttable.Create(application);
> imtable.DatabaseName := 'infofarm';
> imtable.TableName := ed5.Text;
> imtable.TableType := ttparadox;
>
>
> imtable.FieldDefs.Clear;
> imtable.FieldDefs.Add('key', ftfloat,0, true);
> imtable.FieldDefs.Add('name', ftstring, 30, false);
>
> imtable.IndexDefs.Clear;
> imtable.IndexDefs.Add('', 'key', [ixPrimary]);
> imtable.IndexDefs.Clear;
> imtable.CreateTable;
> imtable.Open;
> end;
>
> 하면 인벨류드 파라미터 에러가 납니다!!
> 왜일까요?
> 유니크가 있어도 그런 현상이 나는데,,,