PC SOFT

WINDEV的在线文档

  • Overview
  • How to proceed?
  • Control in a window or in a page: switching from embedded mode to independent mode
  • Report on embedded query: Switching from embedded mode to independent mode
  • Handling an item of the embedded query by programming
  • How to handle the independent or embedded queries?
  • In the page editor or the window editor: Summary table
  • In the report editor: Summary table
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

Creation mode of queries: independent or embedded query

Overview
The query editor proposes two methods for creating a query:
  • creating the query in the query editor ("File .. New .. Query"). This query corresponds to a project element (".WDR" file) and it can be used as data source for a report, a window control or a page control (list box, combo box or table), by programming, in another query, ... The query is said to be independent.creating the query in the query editor:
    • Clickamong the quick access buttons.
    • In the wheel that is displayed, click "Queries" and select the type of query to create.The window for creating a new element is displayed: click "Queries" and select the type of query to create.
      This query corresponds to a project element (".WDR" file) and it can be used as data source for a report, a window control or a page control (List Box, Combo Box or Table control), by programming, in another query, ... The query is said to be independent.
  • creating the query when creating the ListView or table control or when creating the report based on this query ("A query that I want to define now" option in the wizard for creating the control or the report). No specific file is created. The query is said to be embedded.
An embedded query cannot be used as data source for an element (report, ...) other than the one where this query was created.

How to proceed?
WinDevWindowsHFSQLHFSQL Client/ServerHF 5.5OLE DB本地访问

Control in a window or in a page: switching from embedded mode to independent mode

To extract a query from a window control or from a page control:
  1. Display the window or the page in the editor.
  2. Select the control based on an embedded query.
  3. Select "Embedded query .. Open the associated query" from the popup menu of the control.
    Caution: the window or the page must have been saved at least once.

  4. The query editor is opened and the query graph is displayed. In the query editor, select "File .. Export .. To an independent query".The query editor is opened and the query graph is displayed. On the "首页" pane, in the "常规" group, expand "保存" and select "Export .. To an independent query".
  5. Save the new query. The query is now an independent query. It can be used in all the windows, pages and reports of your project.

Report on embedded query: Switching from embedded mode to independent mode

To extract a query from a report:
  1. Display the report on the embedded query (in the report editor).
  2. Select "Edit the query" from the popup menu of the report. The query is displayed in the query editor. Caution: the report must be saved at least once.
  3. In the query editor, select "File .. Export .. To an independent query".On the "首页" pane, in the "常规" group, expand "保存" and select "Export .. To an independent query".
  4. Save the new query. The query is now an independent query.

Handling an item of the embedded query by programming

To access an item of the embedded query from a code of the control or report associated with this query, use the following syntax:

MySource.MyItem

This 我的数据源 keyword is mainly used to handle the parameters of an embedded query (in the reports, combo boxes, list boxes and browsing tables).

Note: the 我的数据源 keyword must not be used in the initialization code of the control or in the opening code of the report.

How to handle the independent or embedded queries?
WinDevWindowsHFSQLHFSQL Client/ServerHF 5.5OLE DB本地访问

In the page editor or the window editor: Summary table

Type of queryEmbedded queryIndependent query
Initialization functionQuery without parameter: Automatic initialization.

Query with parameters: The parameters must be specified:
  • by H执行查询
  • by using the following notation: <Query Name>.<Parameter Name> or MySource.<Parameter Name>
Query without parameter: Automatic initialization.
You also have the ability to use H执行查询.

Query with parameters: The parameters must be specified:
  • by H执行查询
  • by using the following notation: <Query Name>.<Parameter Name>
Function used to pass the hQueryWithoutCorrection constantTransform the embedded query into an independent queryH执行查询

See Browsing tables, list boxes and combo boxes linked to queries for more details.

In the report editor: Summary table

Type of queryEmbedded queryIndependent query
Initialization functionQuery without parameter: 打印初始化报表查询

Query with parameters: The parameters must be specified:
H执行查询, 打印初始化报表查询
Function used to pass the hQueryWithoutCorrection constantTransform the embedded query into an independent queryH执行查询