本帖最后由 wafer_lee 于 2010-02-17 15:36:43 编辑

解决方案 »

  1.   

    本人瑟瑟寒风、孩子哭闹中,在线傻等ing。
      

  2.   

    up up up up,tremendously up.
      

  3.   

    你这代码for语句do之后怎么都没有begin,加一对begin,end,别偷懒!
      

  4.   

     for j:=0 to StringGrid1.RowCount-1 DO
        with adoquery1 do
        begin
        close;
        sql.Clear;
        sql.Add('select top 1 blade_left_no from blade where new_blade_type='''+stringgrid1.Cells[1,j]+'''');
        sql.Add('order by id desc');
        open;
        while not eof do
        begin
        v_blade_left:=fieldbyname('blade_left_no').value +strtoint(StringGrid1.cells[2,j]);
        next;  with adoquery1 do
        begin
        close;
        sql.Clear;
        sql.Add('insert into blade (change_date,shift,change_time,team,machine_no,');
        sql.Add('old_blade_no,old_blade_type,old_blade_life,old_blade_expo,');
        sql.Add('new_blade_no,new_blade_type,change_reason,operator,pcs,');
        sql.Add('inputor,blade_left_no) values ');
        sql.Add('(#'+v_date+'#,'''+spSkincombobox2.text+''','''+v_time+''','''+spSkincombobox3.text+''',8888,');
        sql.Add('''---'',''---'',8888,8888,');
        sql.Add('''---'','''+stringGrid1.Cells[1,j]+''',''领入'','''+spSkinLabel1.caption+''','''+stringgrid1.cells[2,j]+''',');
        sql.add(''''+unit2.user_name+''','+inttostr(v_blade_left)+')');
        showmessage(adoquery1.sql.text);    execsql;楼主的代码,只有Begin,没有end;