PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview
  • How to?
  • Control in a window or in a page: switching from embedded mode to independent mode
  • Report based on an embedded query: Switching from the embedded mode to the independent mode
  • Handling an item of the embedded query by programming
  • How to use the independent or embedded queries?
  • In the page editor or the window editor: Summary table
  • In the report editor: Summary table
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Creation mode of queries: independent or embedded query
ODBCNot available with this kind of connection
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 independent.creating the query in the query editor:
    • Click among 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 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 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?

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 "Home" pane, in the "General" group, expand "Save" and select "Export .. To an independent query".
  5. Save the new query. The query now is an independent query. It can be used in all the windows, pages and reports of your project.

Report based on an embedded query: Switching from the embedded mode to the independent mode

To extract a query from a report:
  1. Display the report on embedded query (in the report editor).
  2. Select "Edit the query" from the popup menu of 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 "Home" pane, in the "General" group, expand "Save" and select "Export .. To an independent query".
  4. Save the new query. The query now is an independent query.

Handling an item of the embedded query by programming

To access an item from the embedded query from the code of the control or the report, use the following syntax:
MySource.MyItem

The keyword MySource makes it possible to manage the parameters of an embedded query (in reports, Combo Box, List Box and browsing Table controls).
Note: the MySource keyword must not be used in the control initialization code or the report opening code.
How to use the independent or embedded queries?
Windows MobileHFSQLHFSQL Client/ServerNative Connectors (Native Accesses)

In the page editor or the window editor: Summary table

Query typeEmbedded queryIndependent query
Initialization functionQuery without parameter: Automatic initialization.

Query with parameters: The parameters must be specified:
  • with HExecuteQuery.
  • 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 HExecuteQuery.

Query with parameters: The parameters must be specified:
  • with HExecuteQuery.
  • by using the following notation: <Query name>.<Parameter name>.
Function used to pass the hQueryWithoutCorrection constantTransform the embedded query into an independent queryHExecuteQuery

See Table, List Box and Combo Box controls linked to queries for more details.

In the report editor: Summary table

Query typeEmbedded queryIndependent query
Initialization functionQuery without parameter: iInitReportQuery

Query with parameters: The parameters must be specified:
HExecuteQuery, iInitReportQuery
Function used to pass the hQueryWithoutCorrection constantTransform the embedded query into an independent queryHExecuteQuery
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment