Selecting a data source

The data source you choose determines how you select the data that will be used in the DataWindow object.

NoteAbout the term data source The term data source used here refers to how you use the DataWindow painter to specify the data to retrieve into the DataWindow object. Data source can also refer to where the data comes from, such as a SQL Anywhere data source (meaning a database file) or an XML data source (meaning an XML file). Connecting to Your Database uses the term data source in this second sense.

If the data is in the database

If the data for the DataWindow object will be retrieved from a database, choose one of the data sources from Table 18-2.

Table 18-2: Data source choices for data from a database

Data source

Use when

Quick Select

The data is from a single table (or from tables that are related through foreign keys) and you need only to choose columns, selection criteria, and sorting.

SQL Select

You want more control over the SQL SELECT statement generated for the data source or your data is from tables that are not connected through a key. For example, you need to specify grouping, computed columns, or retrieval arguments within the SQL SELECT statement.

Query

The data has been defined as a query.

Stored Procedure

The data is defined in a stored procedure.

If the data is not in a database

Web Service data source Select the Web Service data source if you want to populate the DataWindow object with data you obtain from a Web service.

For more information, see “Using a Web service data source”.

External data source Select the External data source if:

You can also use an ODBC driver to access data from a file.

For more information, see Connecting to Your Database.

After you choose a data source in the various DataWindow wizards, you specify the data. The data source you choose determines what displays in the wizards and how you define the data.

Why use a DataWindow if the data is not from a DBMS

Even when the data is not coming from the database, there are many times when you want to take advantage of the intelligence of a DataWindow object: