我寫了一個測試的COM 元件,設定的依各方法,如下所示
function TFO_User.CheckLogin(const UserID, Passwd: WideString;
var ERR: WideString): WordBool;
begin
try
ERR := '';
Result := False;
ADOQuery1.SQL.Clear;
ADOQuery1.Parameters.Clear;
ADOQuery1.SQL.Add('select *,(select top 1 spec from hlotx where lotx=hAutoCall.lotx) as spec from hAutoCall where MachineNo=:MachineNo and PosNo=:PosNo');
ADOQuery1.Parameters.ParamByName('MachineNo').Value := 2;
ADOQuery1.Parameters.ParamByName('PosNo').Value := 3;
ADOQuery1.Open;
try
finally
ADOQuery1.Close;
end;
Result := True;
SetComplete;
except
on E: Exception do begin
ERR := E.Message;
SetAbort;
end;
end;
end;
每次只要執行到紅色那一行,就會出現"project dllhost.exe raise Exception class EOleException;存放裝置空間不足,無法完成此操作"的錯誤,但是只要改成以下的情況就部會了,想請問大大門,是否有遇過這情形,事哪各原因
function TFO_User.CheckLogin(const UserID, Passwd: WideString;
var ERR: WideString): WordBool;
begin
try
ERR := '';
Result := False;
ADOQuery1.SQL.Clear;
ADOQuery1.Parameters.Clear;
ADOQuery1.SQL.Add('select *,(select top 1 spec from hlotx where lotx=hAutoCall.lotx) as spec from hAutoCall where MachineNo=2 and PosNo=3);
ADOQuery1.Open;
try
finally
ADOQuery1.Close;
end;
Result := True;
SetComplete;
except
on E: Exception do begin
ERR := E.Message;
SetAbort;
end;
end;
end;