首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

ADO连接产生'验证失败'异常

2012-03-21 
ADO连接产生验证失败错误?源代码如下:function TBase.Error:Booleanbegintrywith DataModule.qry2 dobe

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

热点排行