aspTest是个TADOStoredProc组件,与其他TADOStoredProc组件使用一个TADOConnection,下面两个语句连在一起,第二条语句当条件成立时出错,有可能是什么问题呢?if aspTest.State <> dsInactive then aspTest.Close;
if aspTest.Connection.Connected then aspTeslt.Connection.Close;
if aspTest.Connection.Connected then aspTeslt.Connection.Close;
if aspTest.Connection.Connected then aspTest.Connection.Close;
请问什么情况下第二条语句出错呢?
if aspTest.Connection.Connected then
aspTest.Connection.Connected:=false;
procedure TCustomConnection.Close;
begin
SetConnected(False);
end;
时出现下面错误信息:Project Test_Query.exe raised exception class EAccessViolation with message 'Access violation at address 0051E082 in module 'Test_Query.exe'. Read of address 00000000'. Process stopped. Use Step Run to continue.
这条语句本身没有错误,但总是由它触发了错误,真是头痛。