首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

BCB中clientdataset中创建表怎么添加多行数据

2012-10-17 
BCB中clientdataset中创建表如何添加多行数据ClientDataSet1-FieldDefs-Clear()ClientDataSet1-FieldD

BCB中clientdataset中创建表如何添加多行数据
ClientDataSet1->FieldDefs->Clear();
 ClientDataSet1->FieldDefs->Add("JGBM",ftString,10,false);
 ClientDataSet1->FieldDefs->Add("KGBH",ftString,10,false);
 ClientDataSet1->FieldDefs->Add("PDBH",ftString,10,false);
 ClientDataSet1->FieldDefs->Add("XLPDBH",ftString,10,false);
 ClientDataSet1->FieldDefs->Add("YXZT",ftString,10,false);
 ClientDataSet1->Close() ;
 ClientDataSet1->CreateDataSet();

 ClientDataSet1->Edit();
 ClientDataSet1->FieldByName("JGBM")->AsString = "1" ;
  ClientDataSet1->FieldByName("KGBH")->AsString = "2";
  ClientDataSet1->FieldByName("PDBH")->AsString = "3";
  ClientDataSet1->FieldByName("XLPDBH")->AsString = "4";
  ClientDataSet1->FieldByName("YXZT")->AsString = "5";
  ClientDataSet1
  ClientDataSet1->FieldByName("JGBM")->AsString = "2" ;
  ClientDataSet1->FieldByName("KGBH")->AsString = "3";
  ClientDataSet1->FieldByName("PDBH")->AsString = "4";
  ClientDataSet1->FieldByName("XLPDBH")->AsString = "5";
  ClientDataSet1->FieldByName("YXZT")->AsString = "6";

我这样好像只能填入一行数据,怎么才能填入多行数据呢

[解决办法]
Append或Insert多次就是多行数据咯。
[解决办法]
哈哈,疏忽了一下

热点排行