读书人

ADO连接产生验证失败异常

发布时间: 2012-03-21 13:33:14 作者: rapoo

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有没有释放过,可能需要重新创建。

读书人网 >.NET

热点推荐