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.
NoteIn the ODBC Sample user interface, SQL statements must be entered on a single line. |
Start the ODBC Sample by tapping Start > Programs > SQLAny10 > ODBC Sample.
Tap Connect.
The sample database starts on a network database server. The Server Messages window appears briefly, then disappears.
Tap ExecSQL to execute the default SQL statement, SELECT * FROM Employees
.
All the data from the Employees table appears in the data window.
Navigate through the data in the Employees table using the scroll bars on the bottom and side of the data window.
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.
Shut down the network database server by tapping Disconnect.
The ODBC Sample disconnects and the network database server automatically shuts down.
Close the ODBC Sample by tapping OK in the bottom left corner of the window.