PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to proceed?
  • 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 proceed?

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 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 "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 of the embedded query from a code of the control or report associated with this query, use the following syntax:
MySource.MyItem
This MySource keyword is mainly used to handle the parameters of an embedded query (in the reports, the combo boxes, the list boxes and the browsing tables).
Note: the MySource keyword must not be used in the initialization code of control or in the opening code of report.
How to use the independent or embedded queries?
WINDEVWEBDEV - Server codeWindowsWindows MobileHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Accesses

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 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:
  • by 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 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: 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 required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment