DELPHI-如何使用内存表(TFDMemTable)

1)将数据从TDataSet复制到TFDMemTable:


 var
   pMemTable : TFDMemTable;
   pQuery : TFDQuery;
begin
   ...
   pMemTable := TFDMemTable.Create( self );
   pMemTable.CloneCursor( pQuery );
   ...


2)定义TFDMemTable结构:


 var
   pMemTable : TFDMemTable;
   pQuery : TFDQuery;
begin
   ...
   pMemTable := TFDMemTable.Create( self );
   pMemTable.FieldDefs.Add( 'key', ftString, 25 );
   pMemTable.FieldDefs.Add( 'value', ftString, 25 );
   pMemTable.CreateDataSet();
   ...
   pMemTable.AppendRecord( [ 'firstkey', 'firstvalue' ] );
   ...














联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678