SQLines Data - Configure and Troubleshoot Connection to Sybase ASE

If you need to connect to a localhost Sybase ASE database you do not need to setup any additional libraries to use SQLines Data tool as they are already supplied with the Sybase ASE server software.

If you need to connect to a remote Sybase ASE database, you need to have Client Library/C (CT-Lib) installed in your system.

Check if you already have Sybase ASE libraries:

  • Linux: ($SYBASE/$SYBASE_OCS/lib)
    • libsybct64.so
    • libsybcs64.so
  • Windows (please make sure, the Sybase library path is added to the PATH environment variable):
    • C:\SAP\ASE-16_0\bin
    • C:\SAP\OCS-16_0\dll
    • C:\sybase\OCS-15_0\lib
  • Files:
    • libsybct64.dll
    • libsybcs64.dll

To install Sybase client software, go to https://developers.sap.com/trials-downloads.html and scroll down to SDK for Adaptive Server Enterprise. Download the latest SDK version for your client platform (Windows or Linux).

Note that you can still use the latest SDK even if you need to connect to old version of the Sybase ASE database i.e. you can use SDK 16 to connect to Sybase ASE 12.5.

Configuring Client Library/C on Linux

Before running sqldata command, add the Sybase Client Library/C location to LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SYBASE/$SYBASE_OCS/lib

Connecting to Sybase ASE

To connect to a Sybase ASE database, you can specify the user name, password, server host name (or IP address), and database name in the following format:

sybase, user/password@hostname:port,database

If you specify the host name or IP address, you must specify the port explicitly; no default value is accepted. Enter the host name or IP address and port in host:port format (for example, srv1:5000 or 10.131.17.1:5000).

For example, to connect to the source Sybase ASE hr database on srv1, use:

-sd=sybase, sybuser/sybpwd@srv1:5000,hr

Alternatively, use a server name defined in the sql.ini interface file:

sybase, user/password@server,database

On Windows, the sql.ini file is located in the %SYBASE%\ini installation directory. An example of sql.ini file:

  [ase1]
  master=NLWNSCK,10.131.17.1,5000
  query=NLWNSCK,10.131.17.1,5000

Now you can connect using the ase1 server name as follows:

-sd=sybase, sybuser/sybpwd@ase1,hr

Note: The port must be specified within the sql.ini file itself; you cannot use the ase1:5000 syntax when connecting via a server name.

Password Encryption

If your Sybase server is configured to require encrypted password connection, you will not be able to login using a plain text password.

To set password encryption, edit sqldata.cfg file and set -sybase_encrypted_password=yes

Troubleshoot Connection to Sybase ASE

Troubleshooting connection errors for Sybase ASE:

ct_connect(): directory service layer: internal directory control layer error: Requested server name not found

If you get the following error message:

Possible reasons:

  • If you specify the host name or IP address, you must specify the port explicitly; no default value is accepted. Otherwise, you will receive this error. Enter the host name or IP address and port in host:port format (for example, srv1:5000 or 10.131.17.1:5000).
  • If you use a server name defined in the sql.ini interface file, make sure the file exists in the proper location. On Windows, run echo %SYBASE%\ini to determine its location and check its entries.

ct_connect(): protocol specific layer: internal Client Library error: There is a tds login error. The installed encryption handler returned a status that was not CS_SUCCEED

If you get the following error message:

Possible reasons:

  • This error occurs when the Sybase client cannot locate the lib3p64 directory. To fix this, add the absolute path (e.g., C:\SAP\OCS-16_0\lib3p64) to your PATH environment variable and restart the tool or command line session.

Contact us at support@sqlines.com if you still have any connection problems.