【发布时间】:2013-11-26 01:35:21
【问题描述】:
打开 dfm 时出现以下错误:
Error reading TSQLConnection1.DriverName: Access violation at address 5147cB94 in module dbexpress180.bpl. Read of address 0000008. Ignore the error and Continue?
dfm文件内容:
object TSQLConnection1: TSQLConnection
ConnectionName = 'AS400'
DriverName = 'CA400'
GetDriverFunc = 'getSQLDriverCA400'
LibraryName = 'dbexpca400.dll'
LoginPrompt = False
Params.Strings = (
'DriverName=CA400'
'Database=ABC'
'User_Name='
'Password='
'ServerCharSet='
'ErrorResourceFile='
'LocaleCode=0000'
'BlobSize=-1'
'RowsetSize=-1'
'RoleName='
'CA400 TransIsolation=DirtyRead'
'CommitRetain=True'
'AutoCommit=True'
'Custom String=/trace=0'
'Connection Timeout=-1'
'UseUnicode=False'
'Trim Char=False')
VendorLib = 'cwbdb.dll'
BeforeConnect = TSQLConnection1BeforeConnect
Left = 32
Top = 24
end
【问题讨论】:
-
在运行时添加组件并使用调试器收集更多信息。您可能希望启用调试 DCU。
-
也许 CA400 驱动程序未在该窗口的 db Express 配置中注册?正在读取 nil 对象的某些属性,因此 DBX 中的某些类工厂可能返回 nil 而不是实例或类
-
@Arioch'The - 你能更详细地解释你的陈述吗?
-
“读取地址 0000008”几乎可以肯定类似于读取
TList(nil).Count- 其他类和其他属性,但想法相同。 “类工厂”是一种众所周知的模式,在 DB Express 中被大量使用。特定 SQL 服务器的驱动程序应在 windows-global DB Express 配置中注册。 -
您是否尝试过创建一个新项目;添加 TSQLConnection 并重现此错误?如果它在新项目中运行良好,请尝试从 DFM 中删除 TSQLConnection 并重新添加。
标签: delphi delphi-xe4