Contents Index Dynamic cursor sample Embedded SQL data types

ASA Programming Guide
  Embedded SQL Programming
    Sample embedded SQL programs

Service examples


The example programs cur.sqc and dcur.sqc, when compiled for a version of Windows that supports services, run optionally as services.

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 a linked executable to be run either as a regular executable or as a Windows service.

To run one of the compiled examples 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 (curwnt.exe or dcurwnt.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 programs display the normal user interface if possible. They also write the output to the Application Event Log. If it is not possible to start the user interface, the programs print one page of data to the Application Event Log and stop.

These examples have been tested with the Watcom C/C++ 10.5 compiler and the Microsoft Visual C++ compiler.


Contents Index Dynamic cursor sample Embedded SQL data types