INI sql anywhere 11 odbc with odbd values for Driver and Setup. Here is the section of the file where you find your information: Ultimately, the client has a software package that uses the Sybase database as the backend, but the frontend to the user does not provide a complete export all tables, and all columns Instead, it only provides simple exports without unique identifiers or useful relational data.
Active9 years, 6 months ago
I'm trying to connect from my ms windows 7 via the odbc administrator to a remotesybase sqlanywhere 11 database server.
![]()
But I get not connection, I'm not sure which configure option I have to specify.
server-name = ip address of remote database server?
startline ?
portnummer ?
Thank you, best regards, Alex
Alex
AlexAlex
2,09077 gold badges3030 silver badges5050 bronze badges
1 Answer
By default the SQL Anywhere server process
dbsrv#.exe listens for incoming connections on port 2638.
Make sure your firewall allows outbound connections to that port.
Assuming you have a database running on your server as follows:
The server will broadcast on the tcp/ip layer on the default port (2638) under the name 'my_server_name' and the database will be accessible under the name 'my_database_name' via ODBC
Creating an ODBC entry for your new database to connect from a client (adjust for Windows 7)
There are other parameters available for LINKS (HOST, etc). Take a look at http://dcx.sybase.com/index.html#1101en/dbadmin_en11/da-using-tcpip.html
I've seen some rare issues with UDP broadcast packets. See the docs at http://dcx.sybase.com/1101en/dbadmin_en11/broadcastlistener-connection-conparm.html and check with your network administrator.
You can also use the
dbping.exe utility to troubleshoot networking issues.
BTW, you may want to cross-post your question at http://sqla.stackexchange.com. It's full of SQL Anywhere buffs
Vincent BuckVincent Buck
13.6k22 gold badges1616 silver badges2121 bronze badges
Not the answer you're looking for? Browse other questions tagged odbcsqlanywhereadministrator or ask your own question.Skip to end of metadataGo to start of metadataPurpose
The purpose of this page is to discuss the configuration of ODBC client connections in the context of SQL Anywhere and Linux or Unix.
Overview
To work with your data, a connection must be established between a client application and a database server (serving a database or database file(s)).
ODBC (which stands for Open Data Base Connectivity) is an industry-standard interface to relational database management systems (RDBMSs). An ODBC data source encapsulates the information required to connect to a database. SQL Anywhere supports the ODBC interface on all platforms. ODBC data sources can be used to connect to SQL Anywhere from ODBC client applications, such as Sybase Central and Interactive SQL.
If the client computer is running Linux or another UNIX operating system, ODBC data sources can be used to connect with ODBC applications, as well as for Sybase Central and Interactive SQL.
Understanding Linking for ODBC Applications on Linux and Unix Operating Systems
ODBC is an application programming interface (API) that is invoked by the client program to connect to a database server. For a list of available ODBC API commands that a program can use, see Microsoft's ODBC API reference. In order to reference the ODBC API library, an ODBC program will refer to 'unixodbc.h' in its #include section and is then linked against a named library when it is compiled. unixodbc.h is included in the SQL Anywhere SDK directory.
The choice of how to link against the ODBC libraries at runtime is then up to the ODBC application developer:
1. Linking against the generic ODBC driver manager available on the Operating System
An example of a gcc application compile that would reference a generic ODBC library uses the switch '-lodbc':
gcc -lodbc odbc.c
This tells the application at load time to attempt to load the libodbc.so library file from the system path specified by the LD_LIBRARY_PATH environment variable. Typically this file will point to a third-party ODBC Driver Manager library. Linux and Unix systems do not come with a default ODBC driver manager - a separate driver manager must be downloaded and configured. Popular third-party ODBC Driver Managers that are available for many Linux and Unix distributions are unixODBC ( http://www.unixodbc.org/ ) and iODBC ( http://www.iodbc.org/ ).
2. Linking against a specific ODBC driver manager (SQL Anywhere ODBC Driver Manager for Unix)
Included with SQL Anywhere is the SQL Anywhere ODBC driver manager for Unix - this library is included as libdbodm16.so in the /lib32 or /lib64 directories. To use this alternate ODBC driver manager, a developer can either create a symbolic link from 'libodbc.so' to 'libdbodm16.so' and continue to link against the generic ODBC library as shown in the generic linking instructions above or a developer can link directly against the SQL Anywhere ODBC driver manager instead:
gcc -ldbodm16 sqlaodm.c
If an ODBC driver manager is loaded, it will then proceed to load 'libodbcinst.so' to find the 'odbc.ini' information for the ODBC data source (see below). The client application can then use either the SQLConnect or SQLDriverConnect ODBC calls to connect to the database. If using SQLDriverConnect, the connection string information should contain 'DRIVER=SQL Anywhere 16' to load 'libdbodbc16.so' directly.
3. Linking against a specific ODBC driver (SQL Anywhere ODBC Driver)
Applications can also directly link against the SQL Anywhere ODBC driver library and have the ODBC driver act as its own driver manager. Developers can use a SQLDriverConnect call to SQL Anywhere with all of the required connection string information specified (outside of a DSN / odbc.ini information). The connection string information should contain 'DRIVER=SQL Anywhere 16' to load 'libdbodbc16.so' directly.
gcc -ldbodbc16 sqlaoodbc.c
Using Threaded Versus Non-threaded Client Libraries
Both threaded and non-threaded client libraries are provided with SQL Anywhere - it is important that your application selects the correct library at runtime. The threaded libraries all have names ending in _r. If your application is directly using ODBC, it is strongly recommended that you use the libdbodbc16 library shipped with SQL Anywhere 16, which automatically loads the appropriate non-threaded (libdbodbc16_n) or threaded (libdbodbc16_r) ODBC library, based on the application's thread needs. There is very little overhead added by using the libdbodbc16 library. Developers also have the option of referencing either the threaded or non-threaded libraries directly, but if this option is used the developer must ensure that they use and deploy the correct library for their application.
Understanding ODBC Data Sources
Data sources (DSNs) exist on the client computer. You should create one for each database accessible via ODBC. Data source definitions reside in the .odbc.ini file or in a separate .dsn file.
.odbc.ini
ODBC clients look for .odbc.ini in the following locations:
Note that it is possible to connect to databases without a data source by specifying all of the connection parameters in the connection string.
Installing the SQL Anywhere ODBC Driver
To connect to SQL Anywhere from ODBC applications on Linux, deploy the SQL Anywhere ODBC driver. Copy the required files to a deployment directory:
With the SQL Anywhere ODBC driver installed, you can create an ODBC data source (DSN) that uses this driver. You can do this by using a third-party ODBC driver manager, use the include ODBC driver or the SQL Anywhere driver itself can be configured to act as an ODBC driver manager. However, choosing to use the driver as a driver manager limits you to connecting only to a SQL Anywhere data source.
Using a true driver manager allows you to manage any number of drivers and data sources. Two driver managers that are widely available are unixODBC and iODBC. Instructions for setting up one of these driver managers for use with the SQL Anywhere driver follow.
Driver Managers and SQL AnywhereUsing unixODBC and SQL Anywhere
In order to connect to SQL Anywhere with a DSN, create an .odbc.ini file with the following details:
You can use any standard SQL Anywhere connection string options in this definition, using the name=value pairs.
You can also add a section to odbcinst.ini if you wish to refer to the driver by name:
Performing an ODBC Trace Using unixODBC
An ODBC trace can be performed using unixODBC to help trace ODBC connections. Simply add the following information to the .odbc.ini section entry:
Creating SQL Anywhere Data Sources with the dbdsn Utility
As an alternative to directly editing .odbc.ini to create ODBC data sources,SQL Anywhere includes a data source utility called dbdsn. The following is an example that shows how to use dbdsn:
dbdsn -w 'SQLATestDSN' -c 'uid=dba;pwd=sql;server=myserver;dbn=mydatabase;dbf=/opt/sqlanywhere16/demo.db'
To control which file dbdsn writes to, set the ODBCINI environment variable. For more information about this environment variable, see .odbc.ini and Understanding ODBC data sources.
The dbdsn utility is not an ODBC driver manager. Rather, the Data Source utility is a cross-platform alternative to the ODBC Administrator for creating, deleting, describing, and listing SQL Anywhere ODBC data sources.
Testing ODBC ConnectionsTesting Acccess to Data Sources Using Interactive SQLSql Anywhere 11 Odbc Driver 64 Bit Download
NOTE: dbisql uses JDBC to connect to the database, but can access the DSN information from ODBC
Note that it is possible to do the above in one step and with no GUI using the -nogui option in your Interactive SQL command:
dbisql -c 'dsn=SQL Anywhere 16 Demo' -nogui 'SELECT * FROM department'
Building the SQL Anywhere ODBC Sample
Configuring the SQL Anywhere ODBC Driver directly as a Driver ManagerSql Anywhere 11 Download
You can use the SQL Anywhere ODBC driver as a driver manager on the system if you will only be connecting to SAP SQL Anywhere databases. However, doing this will prevent you from loading any driver other than the SQL Anywhere driver.
To use SQL Anywhere ODBC driver directly as a driver manager, you need to create symbolic links so that ODBC driver manager requests get routed to the SQL Anywhere ODBC driver. From the /opt/sqlanywhere16/lib32 or /opt/sqlanywhere16/lib64 subdirectory, execute the following commands:
cd /opt/sqlanywhere16/lib64 ln -s libdbodbc16.so libodbc.so ln -s libdbodbc16.so.1 libodbc.so.1
Microsoft Odbc Driver 10 For Sql ServerRelated Product DocumentationComments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |