我用adocommand的时候,提示错误“对象已在集合中,无法追加”,不知道什么意思。我想我的代码应该没有问题,是这样的,同样这段代码运行第一次的时候就不会出错,但是第二次,三次就会出现这个错误,哪位大侠给我点意见,好么?我在线等………………分不够的话,在开贴加分

解决方案 »

  1.   

    ls_SQL := ' Update image set image = :image1, imagesize = :li_Filesize Where' +
              ' sno =''' + inttostr(ll_sno) + '''' + ' and fele_no = ''' + ls_fele_no + '''';
            adc_Edit.Parameters.Clear;
            adc_Edit.CommandText :='';
            adc_Edit.CommandText := ls_SQL;
            adc_Edit.Prepared;
            adc_Edit.Parameters.Items[0].LoadFromFile(Ls_Path + '\temp' + '\' + inttostr(ll_sno) + ls_fele_no + '.cmp', ftBlob);
            adc_Edit.Parameters.Items[1].Value := li_filesize;
            adc_Edit.Execute;
      

  2.   

    我没有把代码全部贴完,错误就在adc_Edit.CommandText := ls_SQL;这句
      

  3.   

    fbysss(独孤求败)  麻烦帮我看看
      

  4.   

    adc_Edit.CommandText := ls_SQL;
    这句不过是字符串赋值,怎么会出错?
      

  5.   

    执行完后,close一个试试呢,
      

  6.   

    第三句这句  adc_Edit.Execute;
     出错了???