Contents Index Building the sample ODBC program ODBC handles

ASA Programming Guide
  ODBC Programming
    ODBC samples

Running the sample ODBC program


The sample program odbc.c, when compiled for versions of Windows that support services, runs optionally as a service.

The two files containing the example code for Windows services are the source file ntsvc.c and the header file ntsvc.h. The code allows the linked executable to be run either as a regular executable or as a Windows service.

To run the ODBC sample

  1. Start the program:

  2. Choose a table:

To run the ODBC sample as a Windows service

  1. Start Sybase Central.

  2. In the left pane, select Adaptive Server Anywhere 9.

  3. In the right pane, select the Services tab.

  4. From the File menu, choose New > Service.

    The Service Creation wizard appears.

  5. On the first page, enter a name for the service.

  6. On the second page, select Sample program.

  7. On the third page, browse to the sample program (odbcwnt.exe) from the Samples\ASA\C subdirectory of your SQL Anywhere directory.

  8. Complete the wizard to install the service.

  9. Click Start on the main window to start the service.

When run as a service, the program displays the normal user interface if possible. It also writes the output to the Application Event Log. If it is not possible to start the user interface, the program prints one page of data to the Application Event Log and stops.


Contents Index Building the sample ODBC program ODBC handles