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了吗?
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了吗?
一开始怎么会处于open状态呢。你可以把错误贴出来,帮你顶
语句是没问题的
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
就是提示的错误啊!!!
在线程中开始部分加入 COINITIALIZE(NULL)
线程末尾加入COUNINITIALIZE()