i have to select all rows using the folowing sentences, but any bettre solution since my method will take very long time to finish ??? thanks !!!!!!
for (pDS->First(); !pDS->Eof; pDS->Next()) { DBGrid1->SelectedRows->CurrentRowSelected=true; }
if (SaveDialog1->Execute()){
ExportFileName= SaveDialog1->FileName.c_str();
outf=fopen(ExportFileName,"w+");
if (Dat_Row > 0) {
//pDS->First();
for (int i = 0; i < Dat_Row; i++){
ProgressBar1->Visible=true;
ProgressBar1->Position = i;
pDS->GotoBookmark((void *)DBGrid1->SelectedRows->Items[i].c_str());
for (int j = 0; j < Dat_Column; j++) {
fprintf(outf,"%s ",pDS->Fields->Fields[j]->AsString);
}
fprintf(outf,"\n" );
} // for i < ...
} // Dat_Row > 0
fclose(outf);
}// if save dialog
--------------------next---------------------
阅读(1013) | 评论(0) | 转发(0) |