Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

9 Make sure the Views check box is toggled on and click OK when finished.

The Choose SQL Table dialog box appears.

10 Highlight your query in this list box, then click OK.

The Design Tab appears with the Insert Fields dialog box. Your Access query, and all fields associated with that query, appear on the Database Tab of the Insert Fields dialog box.

NOTE: You can not use Access action queries or update queries in Seagate Crystal Reports. You can use Access select queries and cross-tab queries.

How to open Access parameter queries

Access parameter queries can only be opened when an Access database is opened via ODBC. Make sure you have an ODBC data source set up for your Access database before attempting this procedure. See How to set up an ODBC data source, Page 562.

558

Seagate Crystal Reports User’s Guide

NOTE: When you design a parameter query in Access, you must provide a prompt for the query and specify a data type for the parameter. First, with your query open in Design View in Microsoft Access, enter a prompt in the Criteria cell for the field

that will act as a parameter. Then, choose the PARAMETERS

command from the Query menu in Access, and specify a data type for the parameter you just created. Make sure the prompt appears exactly as it does in the Criteria cell. For complete instructions,

refer to your Access documentation. If you do not set up your parameter query correctly, Seagate Crystal Reports will not be able to use it.

In Seagate Crystal Reports, choose the OPTIONS command from the File menu. The File Options dialog box appears. Click the SQL Tab to activate it.

2 Make sure either the Stored Procedures or the Prompt on every table check box is toggled on.

The Stored Procedures option automatically displays any available stored procedures when you log on to an ODBC data source. Seagate Crystal Reports treats Access parameter queries much like it treats SQL stored procedures. So, to use a parameter query, the Stored Procedures option must be toggled on.

Working With Databases

559

The Prompt on every table option displays the Allow Reporting On dialog box every time you log on to an ODBC data source. This dialog box provides the same options as the Allow Reporting On section of the File Options dialog box, but provides those options for every ODBC data source you log on to.

!In addition, you can specify Table name LIKE and Owner LIKE options if you wish.

Table name LIKE is based on the SQL LIKE clause. This option allows you to specify the kinds of table names you want to appear in the Choose SQL Table dialog box. Use the underscore character (_) or the percent sign character (%) as wildcards with this function. The underscore character specifies any single character, while the percent sign signifies any character string. For example, DAV_ matches DAVE only, while DAV% matches DAVE and DAVID. Table name LIKE C% would display only those tables that have a table name beginning with the letter C.

Owner LIKE is also based on the SQL LIKE clause. The Owner LIKE option allows you to select the Owner (or Creator or Alias) of the table, not the table name itself. For example Owner LIKE C% would display only those tables that had an owner beginning with the letter C.

" Click OK to exit the File Options dialog box.

#Create a new report. When you choose SQL/ODBC as the source of your data, the Log On Server dialog box appears.

6 Choose the ODBC data source for your Access database, then click OK.

%If you did not specify a particular Access database file with your Access ODBC data source, the Select Database dialog box will appear. Locate and highlight the database containing the Access parameter query you want to use, and click OK.

560

Seagate Crystal Reports User’s Guide

&If you selected the Prompt on every table check box in the File Options dialog box, the Allow Reporting On dialog box now appears. Otherwise, skip to Step 11.

9 Make sure the Stored Procedures check box is selected and click OK when finished.

The Choose SQL Table dialog box appears. Access parameter queries appear in the SQL Tables list box as:

Proc(QueryName)

11 Highlight your query in this list box, then click OK.

The Stored Procedure Input Parameters dialog box appears.

Working With Databases

561

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]