当我尝试从数据源填充DBGrid时遇到问题:
我的代码
void MyClass::initializeGridView()
{
String sqlFilter = SrcQryStringList->Text + QueryStringList->Text;
FilterSQLQuery->Close();
FilterSQLQuery->SQL->Clear();
FilterSQLQuery->SQL->Add(sqlFilter);
FilterSQLQuery->Active = true;
DocumentsDataSetProvider = new TDataSetProvider(this) ;
DocumentsDataSetProvider->DataSet = FilterSQLQuery;
DocumentsDataSetProvider->Name ="DocumentsDataSetProvider";
DocumentsClientDataSet = new TClientDataSet(this);
DocumentsClientDataSet->ProviderName = DocumentsDataSetProvider->Name ;
DocumentsClientDataSet->Active = true; // "insufficient memory for this operation"
DocumentsDataSource= new TDataSource (this);
DocumentsDataSource->DataSet = DocumentsClientDataSet;
JvDBGrid1->DataSource = DocumentsDataSource;
delete DocumentsDataSetProvider;
}
FilterSQLQuery是一个TSQLQuery,JvDBGrid1是一个DBgrid
我收到此错误"此操作的内存不足"返回行数很高!
THX