Access Violation when connecting to Sybase ASE with dbExpress

Abstract: Access Violation when connecting to Sybase ASE with dbExpress

Product: Borland Developer Studio 2006

Problem Description

When attempting to connect to Sybase ASE, I receive the following error message:

Failure to Connect: Access violation at address 1D50C52A in module 'dbxase30.dll'. Read of address 00000004


Problem Resolution

This error can be caused when the Sybase client cannot resolve the HostName property. The dbExpress HostName property is not a TCP/IP hostname but actually needs to map to an entry in the Sybase client sql.ini file. If the SYBASE environment variable is not set, the Sybase client is unable to locate the sql.ini file and the Access Violation will result.

Set the SYBASE environment variable to the root of your Sybase client install, normally c:\sybase or the parent of the directory containing sql.ini.