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

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - 数据库管理 » 启动并连接到数据库 » SQL Anywhere for Windows Mobile » 使用 Windows Mobile 示例应用程序

 

ESQL 示例

ESQL 示例是一个使用嵌入式 SQL 编程接口的简单应用程序。可通过此应用程序启动网络数据库服务器上运行的示例数据库,并能使用 SQL 语句访问数据。

此示例的源代码位于 samples-dir\SQLAnywhere\ce\esql_sample

您可以将此项目文件通过以下位置装载到 Visual Studio 2005 中:samples-dir\SQLAnywhere\ce\sql_sample\esql_sample.sln

注意

在 [ESQL Sample] 用户界面中,SQL 语句必须 在同一行中输入。

♦  使用 ESQL 示例
  1. 单击 [开始] » [程序] » [SQLAny11] » [ESQL Sample],启动 [ESQL Sample]。

  2. 单击 [Connect],使用缺省连接字符串连接到示例数据库。

  3. 单击 [ExecSQL] 执行缺省 SQL 语句 SELECT * FROM Employees

    Employees 表中的数据出现在数据窗口中。

  4. 使用滚动条查看 Employee 表数据。

  5. 要访问 Customers 表中的数据,键入 SELECT * FROM Customers,然后单击 [ExecSQL]。

    在数据窗口中,Customer 数据替换 Employee 数据。

  6. 单击 [Disconnect] 关闭网络数据库服务器。

    [ESQL Sample] 即会断开连接,并关闭网络数据库服务器。

  7. 单击窗口右上角的 [x],关闭 [ESQL Sample]。