0
votes

While opening a dfm, I am getting following error:

Error reading TSQLConnection1.DriverName: Access violation at address 5147cB94 in module dbexpress180.bpl. Read of address 0000008. Ignore the error and Continue?

Content of dfm file:

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
1
Add the component at runtime and use the debugger to collect more information. You might want to enabled debug DCUs. - jpfollenius
maybe CA400 driver is not registered in db Express configuration on that windows ? some property of nil object is being read, so probably some class factory in DBX returne nil instead of an instance or class - Arioch 'The
@Arioch'The - Can you explain your statement in more detail please? - user1556433
"Read of address 0000008" is almost certain something like reading TList(nil).Count - other class and other property, but the same idea. "Class Factory" is a well known pattern and used a lot in DB Express. Drivers for specific SQL servers should be registered in windows-global DB Express configuration. - Arioch 'The
Have you tried to create a new project; add a TSQLConnection and reproduce this error? if it works fine in a new project try to delete TSQLConnection from the DFM and add it again. - kobik

1 Answers

2
votes

With the help of Arioch's comment "maybe CA400 driver is not registered in db Express configuration on that windows", I am able to resolve my problem.

I looked into my dbxdrivers.ini file located at C:\Users\Public\Documents\RAD Studio\dbExpress\11.0, the driver CA400 was not installed. I found below article on codegear:

http://cc.codegear.com/partners/delphi8/peter_sawatzki/dbexpca400/index.html

All the steps for installing CA400 drivers are mentioned here. As per article,

  1. Downloaded latest version of dbexpca400.dll from embarcadero (http://cc.embarcadero.com/item/28436), extracted and put dll into C:\Windows\System32 folder.

  2. Put following code in my dbxdrivers.ini file

[CA400]

GetDriverFunc=getSQLDriverCA400
LibraryName=dbexpca400.dll
VendorLib=cwbdb.dll
Database=MYAS400
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
Trim Char=False

[CA400 TransIsolation]
DirtyRead=0
ReadCommited=1
RepeatableRead=2

and error got resolved.