Using the ODBC Sample

 Use 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 %SQLANYSAMP12%\SQLAnywhere\ce\odbc_sample.

You can load this project file in Visual Studio 2005 from: %SQLANYSAMP12%\SQLAnywhere\ce\odbc_sample\odbc_sample.sln.

Note

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

  1. Start the ODBC Sample by tapping Start » Programs » SQLAny12 » ODBC Sample.

  2. Tap Connect.

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

    Data from the Employees table appears in the data window.

  4. Use the scroll bars to view Employee table data.

  5. To access data in the Customers table, type SELECT * FROM Customers and tap ExecSQL.

    Customer data replaces the employee data in the data window.

  6. Tap Menu » Disconnect to shut down the network database server.

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

  7. Close the ODBC Sample.