CreateDataSet

__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
  TFieldDefs *pDefs = CDS2->FieldDefs;
  TFieldDef *pDef = pDefs->AddFieldDef();
  pDef->DataType = ftInteger;
  pDef->Name = "Field1";
 
  pDef = pDefs->AddFieldDef();
  pDef->DataType = ftString;
  pDef->Size = 10;
  pDef->Name = "Field2";
 
  TIndexDef *pIDef = CDS2->IndexDefs->AddIndexDef();
  pIDef->Fields = "Field1";
  pIDef->Name = "IntIndex";
CDS2->FieldDefs->Add("ID",ftString,10,true);  // ok
CDS2->CreateDataSet();}
 
  



CDS2->FieldDefs->Add("ID",ftString,10,true);  // ok
   CDS2->CreateDataSet();}



你可能感兴趣的:(C++builder)