Button1中的命令:
  aqrTest.Close;
  aqrTest.SQL.Clear;
  aqrTest.SQL.Add('update jobs set job_desc = :desc where job_id = 2');
  aqrTest.Parameters.ParamByName('desc').Value := Edit1.Text;
  try
    aqrTest.Execsql;
  except
    on E:exception do
    showmessage(e.Message);
  end;
如果一开始aqrTest是处于Close状态上面的命令是正常的,但是如果一开始aqrTest是处于Open状态是执行上面的命令就会报错,请问为什么,我不是已经用了Close了吗?

解决方案 »

  1.   

    设计的时候应该都是close状态呀,怎么可能处于open状态 ?
    一开始怎么会处于open状态呢。你可以把错误贴出来,帮你顶
      

  2.   

    你OPEN以后是不是进行了操作或修改没有POST呀?
    语句是没问题的
      

  3.   

    Button2中的命令:
      aqrTest.Close;
      aqrTest.SQL.Clear;
      aqrTest.SQL.Add('select * from jobs');
      try
        aqrTest.Open;
      except
        on E:exception do
        showmessage(e.Message);
      end;
    如果没按Button2之前按Button1都是正常的,但一旦按了Button2再按Button1就会报错了。
    Access violation at address 1F453E6E in module 'msado15.dll'.Write of address 01176028
      

  4.   

    Access violation at address 1F453E6E in module 'msado15.dll'.Write of address 01176028
    就是提示的错误啊!!!
      

  5.   

    你是不是在线程中使用了ADO?
    在线程中开始部分加入 COINITIALIZE(NULL)
      线程末尾加入COUNINITIALIZE()