DBAccess.pas中的断言失败 [英] Assertion failure in DBAccess.pas

查看:157
本文介绍了DBAccess.pas中的断言失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣将一套软件从ODAC v5升级到v8.2.8.

I am interested in upgrading a suite of software from ODAC v5 to v8.2.8.

特别是一个应用程序会引起问题.此应用程序加载以dll形式实现的一组辅助应用程序中的一个.

One app in particular is causing problems. This application loads one of a set of secondary applications implemented as dlls.

LibHandle := LoadLibrary(PChar(dllname));
if LibHandle <> 0 then
begin
  @showForm := GetProcAddress(LibHandle,'ShowMainDllForm');
  if (@showForm <> nil) then
  begin
    try
      ShowForm(Application.Handle, @FGlobalVars, 1);

启动器很好-它具有自己的数据库连接,我可以很高兴地逐步完成各个ODAC单元.

The launcher is fine - it has its own database connection, and I can step through the various ODAC units fairly happily.

但是,dll会立即例外,除非尝试打开游标.错误是从MemDs.pas调用的单元DBAccess.pas中的断言失败.我已逐步解决了这个问题,并证明断言失败是正确的. Assert(FieldDesc is TCRFieldDesc)正在从MemDS.CreateFieldDefs()接收TFieldDesc.

However, the dll immediately excepts on attempting to open a cursor. The error is an Assertion Failure in the unit DBAccess.pas, called from MemDs.pas. I have stepped through this and have shown that the assertion failure is correct; Assert(FieldDesc is TCRFieldDesc) is receiving a TFieldDesc from MemDS.CreateFieldDefs().

我很困惑.一种调用方法(启动器应用程序)工作正常而另一种(dll)总是失败,怎么可能?

I am stumped. How can it be that one calling method works fine (the launcher app) and the other (the dll) always fails ?

如果任何人在这方面遇到困难,我将不胜感激,尽管听起来很微妙

If anyone has experienced difficulties in this area I would appreciate any information, however tenuous it might sound

推荐答案

我们已经解决了此问题.您可以下载最新的ODAC版本8.6.12,也可以修改调用Assert的行:

We have already fixed this problem. You can either download the latest ODAC version 8.6.12 or modify the line invoking Assert:

在TCustomDADataSet.GetFieldType方法中

in the TCustomDADataSet.GetFieldType method

replace 
  Assert(FieldDesc is TCRFieldDesc);
with
  Assert(IsClass(FieldDesc, TCRFieldDesc));

这篇关于DBAccess.pas中的断言失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆