ADO连接产生'验证失败'错误?
源代码如下:
function TBase.Error:Boolean;
begin
try
with DataModule.qry2 do
begin
SQL.Clear;
SQL.Add('SELECT ID, Type, [User], [Key] INTO Table1 FROM table2 WHERE id in '
+'(select id from VI where U_Ans <> [Key]) order by id');
ExecSQL;
end;
if DataModule.qry2.RecordCount > 0 then
begin
with DataModule.qry1 do
begin
SQL.Clear;
SQL.Add('select * from table2 where id in (select id from Table1)');
Open;
end;
Result := True;
end
else Result := False;
except
Result := False;
end;
end;
这个是在自定义类中的,在程序中执行这个过程时提示::……raised exception class EOleException with message '验证失败',其它过程都没问题呀,哪位大哥指点一下,兄弟刚学的。
[解决办法]
自定义类中的datamodule有没有释放过,可能需要重新创建。