AnyDAC
ContentsIndexHome
PreviousUpNext
Connect to Sybase SQL Anywhere

Describes how to connect to Sybase SQL Anywhere.

Group
Links
Supported versions

The AnyDAC native driver supports Sybase SQL Anywhere version 5 and higher. 

 

Windows client software

AnyDAC requires one of the Sybase SQL Anywhere x86 or x64 ODBC drivers to be installed on the workstation:

  • "Adaptive Server Anywhere" ODBC driver to connect to v 5-7.
  • "SQL Anywhere N" ODBC driver, where N is the DBMS major version number (e.g. 8, 9, 10).

The preferred driver is "SQL Anywhere N". The ODBC driver is part of Sybase SQL Anywhere SDK. You can download it from there

When the SQL Anywhere ODBC driver has not been properly installed, you will get an exception when you try to connect: 

 

[AnyDAC][Phys][ODBC][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

 

If your application is using SQL Anywhere service components, like a TADASABackup, then following DLL's additionally required to be installed on the workstations:

  • DBTOOL<N>.DLL;
  • DBLIB<N>.DLL.

There N is a version of your SQL Anywhere. 

 

Mac OS X client software

AnyDAC requires:

  • the UnixODBC (libodbc.dylib) x86 ODBC driver manager library;
  • the SQL Anywhere (libdbodbcNN.so) x86 ODBC driver.

SQL Anywhere client software for Mac OS X may be downloaded from there. After installing:

  • add the following to /usr/local/etc/odbcinst.ini:

 

[SQL Anywhere]
Description=SQL Anywhere v 12
Driver=/Applications/SQLAnywhere12/System/lib32/libdbodbc12.dylib
Setup=/Applications/SQLAnywhere12/System/lib32/libdbodbc12.dylib
UsageCount=1

 

  • remove libodbcinst.dylib link from /Applications/SQLAnywhere12/System/lib32 folder, as it conflicts with UnixODBC libodbcinst.dylib. This action was recommended by Sybase development team.
  • run /Applications/SQLAnywhere12/System/bin32/sa_config.sh

 

Driver linkage

To link the driver:

 

Connection definition parameters

To connect to a SQL Anywhere DBMS, most applications will need to specify DriverID, Server, Database, OSAuthent, User_Name and Password

 

DriverID=ASA  

Parameter 
Description 
Example value 
Server 
Specifies the name of a running database server to which you want to connect. 
ASASrv 
Database 
Identifies a loaded database to which a connection needs to be made when connecting to a database that is already running. 
 
OSAuthent 
Controls authentication mode:
  • Yes - an integrated login is attempted;
  • No - the DBMS login is used. This is default value.
 
No 
User_Name 
Specifies the user ID used to log in to the database, if OSAuthent=No. 
dba 
Password 
Specifies the user password used to log in to the database, if OSAuthent=No.
Note, the passwords with both '{' and '}' are not supported. 
sql 
DatabaseFile 
Indicates which database file you want to load and connect to when starting a database that is not already running. If you want to connect to an already-running database, use the Database parameter. 
 
Compress 
Controls network traffic compression:
  • Yes - to turn compression on for a connection;
  • No - to turn compression off. This is the default value.
 
Yes 
Encrypt 
Encrypts packets sent between the client application and the server using transport-layer security or simple encryption. The value syntax is { NONE | SIMPLE | TLS( TLS_TYPE=cipher; [ FIPS={ Y | N }; ] TRUSTED_CERTIFICATES=public-certificate ) } 
  • tls(tls_type=rsa;fips=n;trusted_certificates=rsaserver.crt)
  • simple
 
LoginTimeout 
Controls the amount of time (in seconds) an application waits for a connection attempt to timeout while waiting to establish a connection (0 specifies an infinite wait). 
30 
ApplicationName 
Assists administrators in identifying the origin of particular client connections from a database server. The string can be retrieved using the statement: SELECT CONNECTION_PROPERTY('AppInfo') 
AllBooks 
ODBCAdvanced 
Allows to specify any other additional ODBC connection parameter value. The default value is "CommLinks=ShMem,TCP". Please note that, if CommLinks is specified, the server will not auto start. 
AutoStart=Yes;CharSet=Windows-1251 
MetaDefCatalog 
Default database name. Design time code will exclude the catalog name from the object name if it is equal to MetaDefCatalog. 
addemo 
MetaDefSchema 
Default schema name. Design time code will exclude the schema name from the object name if it is equal to MetaDefSchema. 
dba 

 

Usage cases

Auto start local server and open database file "C:\sybase\addemo_asa10.db": 

 

DriverID=ASA
ODBCAdvanced=AutoStart=Yes
DatabaseFile=C:\sybase\addemo_asa10.db
User_Name=dba
Password=sql
MetaDefSchema=dba

 

  • Connect to a default local server

 

DriverID=ASA
User_Name=dba
Password=sql
MetaDefSchema=dba

 

  • Connect to the database ADDemo, running on server instance ASASrv:

 

DriverID=ASA
Server=ASASrv
Database=ADDemo
User_Name=dba
Password=sql
MetaDefSchema=dba

 

  • Connect to the database ADDemo, running on the server instance ASASrv in another network:

 

DriverID=ASA
ODBCAdvanced=CommLinks=tcpip(host=227.12.66.1)
Server=ASASrv
Database=ADDemo
User_Name=dba
Password=sql
MetaDefSchema=dba
What do you think about this topic? Send feedback!