Q&A

  • Paradox DB file을 코딩만으로 만들 수 있나요?
안녕하세요

Paradox DB 화일을 델파이 코딩만으로 만들수 있나요?

아시는분 방법좀 가르켜 주세요.

그럼 좋은 주말 되세요..^^
2  COMMENTS
  • Profile
    최석기 2002.03.26 22:56
    // 인덱스가 없는 테이블생성
    procedure CreateATable(DBName,            //Alias or path
                           TblName : String); //Table Name to Create
    var
      tbl : TTable;
    begin
      tbl := TTable.Create(Application);
      with tbl do begin
        Active := False;
        DatabaseName := DBName;
        TableName := TblName;
        TableType := ttParadox;
        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;

    //인덱스가 있는 테이블 생성

    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;


  • Profile
    초보 2002.03.27 00:58