UltraLite for M-Business Anywhere User's Guide
Tutorial: A Sample Application for M-Business Anywhere
The first procedure describes how to create an UltraLite database schema. The database schema is a description of the database. It describes the tables, indexes, keys, and publications within the database, and all the relationships between them.
For more information about database schemas, see Creating UltraLite database schema files.
To create an UltraLite database schema
Create a directory for this tutorial.
This tutorial assumes the directory is c:\Tutorial\mbus. If you create a directory with a different name, use that directory throughout the tutorial.
Create the following subdirectories for platform-specific files:
Configure your web server.
Map a virtual directory named tutorial on your web server to c:\Tutorial\mbus. The URL to access this directory will be http://localhost/tutorial.
For Microsoft IIS, you can make these changes from the management tool.
For Apache, make a symbolic link named tutorial from your document root to the c:\Tutorial\mbus directory, or copy the tutorial files into your Apache document root.
Ensure that your web server delivers the following files with MIME type application/octet-stream:
For Microsoft IIS, you can make these changes from the management tool. Go to the virtual directory properties and make the changes under HTTP Headers and File Types.
For Apache, edit the file mime.types in your conf directory.
Create a database schema using the UltraLite Schema Painter.
For more information about creating a database schema, see the 第 1 课:创建 UltraLite 数据库模式.
Schema filename tutcustomer.usm.
Table name Customer
Columns in Customer
| Column Name | Data Type (Size) | Column allows NULL values? | Default value |
|---|---|---|---|
| ID | integer | No | autoincrement |
| FName | char(15) | No | None |
| LName | char(20) | No | None |
| City | char(20) | Yes | None |
| Phone | char(12) | Yes | 555-1234 |
Primary key Ascending ID
Save the database schema.
If you are developing an application for Windows or Windows CE, choose File > Save and choose tutcustomer.usm in the WINCE_OS or the WIN32_OS subdirectory of your tutorial directory as the filename.
If you are developing an application for Palm OS:
From the File menu, choose Export Schema for Palm.
Enter Syb3 as the creator ID.
Save the file as tutcustomer.pdb in the PALM_OS subdirectory of your tutorial directory.
A note on Palm Creator IDsThe creator ID is assigned to you by Palm. You can use Syb3 as your creator ID when you make sample applications. However, when you create a commercial application, you should use your own creator ID. |
If you are developing a cross-platform application, save the schema file in all the above locations.
SQL Anywhere Studio 9.0.2
版权所有 © 1989–2005 Sybase, Inc. 部分版权所有 © 2001–2005 iAnywhere Solutions, Inc. 保留所有权利。