Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2341445
  • 博文数量: 816
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5010
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-17 17:57
文章分类

全部博文(816)

文章存档

2011年(1)

2008年(815)

分类:

2008-12-17 18:07:00

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) |
给主人留下些什么吧!~~