PC SOFT

WINDEV的在线文档

  • Overview
  • Query in a window or in a page
  • Overview
  • Using a query in a window
  • Query in a control found in a WinDev window or in a WebDev page
  • Displaying the result of the query in a List Box, Combo Box, Looper or Table control
  • Using a result item of the query in a control:
  • Query in a report
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
The result of a Select query can be used in:
  • a WinDev application, a WinDev Mobile application or a WebDev site,
  • a window (created by the wizard in WinDev or WinDev Mobile),
  • a page (created by the wizard in WebDev),
  • a window control (table, list box, combo box, ... in WinDev or WinDev Mobile),
  • a page control (looper, table, list box, combo box, ... in WebDev),
  • a report.
The result of an Insert, Update or Delete query can only be used in a program.

ImportantReminder: Reports & Queries cannot be used to create: Insert queries, Update queries, Delete queries.

See Running the query and handling the result with the WLanguage functions for more details.

Query in a window or in a page

Overview

WinDev A query can be used as data source for a window or for a page. The window or the page will display the records selected by the query.

ImportantThe queries created in Reports & Queries can be run from a WinDev application only if this application supports the queries created in Reports & Queries.

WinDev

Using a query in a window

To use a query in a window:
  1. Select "File .. New .. Window".Clickamong the quick access buttons.
    • Click "Window" in the wheel that is displayed.The window for creating a new element is displayed: click "Window" then "Window".
    • The wizard for window creation starts.
  2. In the RAD tab, choose the RAD pattern to use and the type of window to create.
  3. Specify (if necessary) the skin template of the window and validate the creation. The wizard for window creation starts.
  4. In the creation wizard, select the query that must be associated with the window and the items that must be displayed in the window.
  5. Validate. The created window will display the information coming from the associated query.

Query in a control found in a WinDev window or in a WebDev page
WinDev All the controls that can be linked to a data source can be associated with one or more result items of the query (edit control, list box, table, ...).
A query can be used as data source for a control. The control will display the records selected by the query.

ImportantThe queries created in Reports & Queries can be run from a WinDev application only if this application supports the queries created in Reports & Queries.

Displaying the result of the query in a List Box, Combo Box, Looper or Table control

To display the result of the query in a List Box, Combo Box, Looper or Table control:
  1. Open the window or the page into which the List Box, Combo Box, Looper or Table control must be added.
  2. Insert the control associated with the query ("Insert .. Control..."). The wizard for control creation starts.Insert the control associated with the query (via the "Creation" pane of ribbon). The wizard for control creation starts.
  3. Specify that the information displayed in the control comes from an existing query.
  4. Select the query that must be associated with the control and the items that must be displayed in the control.
  5. Validate. The created control will display the information coming from the associated query.
  6. Enter (if necessary) the following code line in the initialization process of the control. This code line is used to initialize and run the query, and to display the result of the query in the current control.
    H执行查询(<Name of Associated Query>)

Using a result item of the query in a control:

To use a result item of the query in a control (other than a List Box, Combo Box, Looper or Table):
  1. Open the window or the page where a control associated with a query must be added.
  2. Create the control associated with the query.
  3. Select "Display .. Description of selection". The description window of the control is displayed.On the "修改" pane, in the "编辑帮助" group, click "描述". The description window of the control is displayed.
  4. Display the "Link" tab in the description window of the control.
  5. Select the item to display in the "Linked item" option.
  6. Validate. The created control will display the information coming from the associated query.
  7. Enter (if necessary) the following code line in the initialization process of the control. This code line is used to initialize and run the query, and to display the result of the query in the current control.
    H执行查询(<Name of Associated Query>)
Note: When creating a Table control associated with a query, you can:
  1. Select the query in the Project" pane directly.
  2. Perform a "Drag and Drop" toward the window. A table associated with the query is automatically created in the window or in the page.

Query in a report
A query can be used as data source for a report. The report will display the records selected by the query.
See Report on query for more details.
Tip: The iconis used to automatically create a report based on the current Select query.Tip: On the "查询" pane, in the "数据库表链接" group, the "创建一个报表" option is used to automatically create a report bassed on the current Select query.