Q&A

  • 소스좀 봐주세요~(SQL문 포함)
안녕하세요..
델파이에 아직 미흡한점이 많아서 이렇게 글올립니다.

아래 소스중에서
====>next; 이 부분에서

'qr_body: Cannot perform this operation on a closed dataset'

란 에러가 뜨는대여..에러 뜻은 대충 알겠는데...
왜저런 에러가 나는지 좀 알려주실수 있나여?
소스가 잘못된거 같은데..--;;
많은답변 부탁드립니다.


            First;
            a := 1;
            Repeat
                sg_body.RowCount := a + 1;

                With qr_body Do
                Begin
                    Active := False;
                    Close;
                    SQL.Clear;
                    SQL.Add('update body set b_d_code = :b_d_code');
                    SQL.Add('               ,b_d_name = :b_d_name');
                    SQL.Add('               ,b_su = :b_su');
                    SQL.Add('               ,b_danga = :b_danga');
                    SQL.Add('               ,b_geum = :b_geum');
                    SQL.Add('         where bodykey = ' + '''' + bodykey_arr[a] + '''');

                    ParamByName('b_d_code').AsString := sg_body.Cells[1, a];
                    ParamByName('b_d_name').AsString := sg_body.Cells[2, a];
                    ParamByName('b_su').Asinteger := StrToInt(sg_body.Cells[3, a]);
                    ParamByName('b_danga').Asinteger := StrToInt(sg_body.Cells[4, a]);
                    ParamByName('b_geum').Asinteger := StrToInt(sg_body.Cells[5, a]);

                    ExecSQL;
                End;

=======>   Next;
                Inc(a);
            Until Eof;
2  COMMENTS