ASA Programming Guide
ODBC Programming
Building ODBC applications
On Windows CE operating systems there is no ODBC Driver Manager. The import library (dbodbc9.lib) defines entry points directly into the Adaptive Server Anywhere ODBC driver dbodbc9.dll.
Separate versions of this DLL are provided for the different chips on which Windows CE is available. The files are in operating-system specific subdirectories of the ce directory in your SQL Anywhere directory. For example, the ODBC driver for Windows CE on the ARM chip is in the following location:
C:\Program Files\Sybase\SQL Anywhere 9\ce\arm.30
For a list of supported versions of Windows CE, see Windows and NetWare operating systems.
To link an ODBC application (Windows CE)
Add the directory containing the platform-specific import library to the list of library directories.
The import library is named dbodbc9.lib and is stored in an operating-system specific location under the ce directory in your SQL Anywhere directory. For example, the import library for Windows CE on the ARM chip is in the following location:
C:\Program Files\Sybase\SQL Anywhere 9\ce\arm.30\lib
Specify the DRIVER= parameter in the connection string supplied to the SQLDriverConnect function.
szConnStrIn = "driver=ospath\dbodbc9.dll;dbf=c:\asademo.db"
where ospath is the full path to the chip-specific subdirectory of your SQL Anywhere directory on the Windows CE device. For example:
\Program Files\Sybase\SQL Anywhere 9\ce\arm.30\lib
The sample program (odbc.c) uses a File data source (FileDSN connection parameter) called ASA 9.0 Sample.dsn. You can create File data sources on your desktop system from the ODBC Driver Manager and copy them to your Windows CE device.
Adaptive Server Anywhere uses an encoding known as UTF-8, a multi-byte character encoding which can be used to encode Unicode.
The Adaptive Server Anywhere ODBC driver supports either ASCII (8-bit) strings or Unicode code (wide character) strings. The UNICODE macro controls whether ODBC functions expect ASCII or Unicode strings. If your application must be built with the UNICODE macro defined, but you want to use the ASCII ODBC functions, then the SQL_NOUNICODEMAP macro must also be defined.
The Samples\ASA\C\odbc.c sample file illustrates how to use the Unicode ODBC features.