Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » SQL Anywhere for Windows CE » Using the Windows CE sample applications

The ESQL Sample Next Page

The ODBC Sample

The ODBC Sample demonstrates a simple application that uses the ODBC programming interface. This application allows you to start the sample database running on the network database server, and access data using basic SQL statements.

The source code for this sample can be found in samples-dir\SQLAnywhere\ce\odbc_sample.

You can load this project file in Visual Studio 2005 from: samples-dir\SQLAnywhere\ce\odbc_sample\odbc_sample.sln.


In the ODBC Sample user interface, SQL statements must be entered on a single line.

To use the ODBC Sample
  1. Start the ODBC Sample by tapping Start > Programs > SQLAny10 > ODBC Sample.

  2. Tap Connect.

    The sample database starts on a network database server. The Server Messages window appears briefly, then disappears.

  3. Tap ExecSQL to execute the default SQL statement, SELECT * FROM Employees.

    All the data from the Employees table appears in the data window.

  4. Navigate through the data in the Employees table using the scroll bars on the bottom and side of the data window.

  5. Access data in another table by typing SELECT * FROM Customers in the ExecSQL field and then tapping ExecSQL.

    All the data from the Customers table appears in the data window, replacing the data from the Employees table.

  6. Shut down the network database server by tapping Disconnect.

    The ODBC Sample disconnects and the network database server automatically shuts down.

  7. Close the ODBC Sample by tapping OK in the bottom left corner of the window.