重大发现:字段数大于25往回写就出错,报错:multiple-step operation generated errors.check each status value.否则就ok,大家帮我看看为什么????
procedure TForm1.DBGrid1DblClick(Sender: TObject);
var
  strgonghao,strexamin,strchapter:AnsiString;
  count:integer;
begin
    if not dm1.adoQuery.Active then
        exit;
    if DBGrid1.SelectedRows.Count>=0 then //只会有一行被选中
      begin
         strgonghao:=dm1.adoQuery1.fieldbyname('工号').AsString;
        dm1.adoquery2.Active:=false;
        dm1.adoquery2.SQL.Clear();
        dm1.adoquery2.SQL.Add('select chrgonghao as 工号,chrname as 姓名,chrdaqu as 大区,chrcity as 城市,decbrowsetime as 浏览时间,intyear as 年,intmonth as 月 ');
    for count:=0 to intchapter-1 do//intchapter:章节数
        strchapter:=Format(strchapter+',intchapterno%d as 第%d章节号,decstudyprogress%d as 第%d章节学习进度,chrchaptername%d as 第%d章节名称,datestartdate%d as 第%d章节开始日期,dateenddate%d as 第%d章节结束日期 ',[count,count,count,count,count,count,count,count,count,count]);
        dm1.adoInfoquery.SQL.Add(strchapter);
        for count:=0 to intexamin-1 do//考试数
        strexamin:=Format(strexamin+',chrexamincode%d as 考试代号%d,chrexaminname%d as 考试名称%d,decachieve%d as 考试成绩%d,datedate%d as 考试日期%d ',[count,count,count,count,count,count,count,count]);        dm1.adoInfoquery.SQL.Add(strexamin);
        dm1.adoInfoquery.SQL.Add(' from '+strCurrQueryT+' where chrgonghao='''+strgonghao+'''');
        dm1.adoInfoquery.Open();
      end;
end;