PC SOFT

WINDEV的在线文档

  • Overview
  • What is a HFSQL context?
  • Independent HFSQL context
  • Transactions and independent HFSQL context
  • Limitation: Data files in 5.5 format and views in Hyper File 5.5 format
  • Limitations: RPC and independent HFSQL context
  • Limitation: Independent HFSQL context and use of an ODBC driver
  • HFSQL contexts and windows
  • How to manage the HFSQL context of a window?
  • If the HFSQL contexts are not independent for each window (option not checked)
  • If the HFSQL contexts are independent for each window (option checked)
  • HFSQL contexts and reports
  • How to manage the HFSQL context of a report?
  • If the HFSQL contexts are not independent for each report
  • If the HFSQL contexts are independent for each 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本地访问

Managing the HFSQL contexts in the windows and in the reports

Overview
A HFSQL context contains the information relative to the data used:
  • Information about the current record: record number, content of items, ...
  • Values of H找到, H超出, ...
  • Characteristics of the current filter
  • Characteristics of the current search
  • Characteristics of the current browse
  • Name of opened files
  • Name and characteristics of queries (H执行SQL查询, H执行查询, SQL执行, SQL执行WDR)
Note: A single transaction is allowed per HFSQL context.

Note: From version 19, HFSQL is the new name of HyperFileSQL.

What is a HFSQL context?

Independent HFSQL context

WinDev allows you to create independent HFSQL contexts:When opening the window (or the report), the existing HFSQL context is automatically "duplicated" (a copy of the existing context is created): the operations performed in each one of the contexts will be independent from the ones performed in the other contexts. The use of an independent context provides the same result as if two instances of the same application were running in parallel.

The management of an independent HFSQL context is recommended for the MDI and multi-thread applications.

The independent HFSQL context is taken into account:

  • When a HFSQL database is handled by the HFSQL functions (starting with the letter H).
  • When a HFSQL database is handled by the SQL functions (starting with the letters SQL)
  • When handling any database via an ODBC driver, by using the SQL functions.
The "Independent HFSQL context" option is currently supported by the following databases:
  • HFSQL and HFSQL Client/Server
  • Native Oracle Access
  • Native SQL Server Access
  • Native Sybase Access
  • Native AS400 Access
  • Native Progress Access
  • Any database via ODBC (SQL commands)
The "Independent HFSQL context" option is not supported by the following databases:
  • Native Informix Access
  • Native DB2 Access
  • Native MySQL Access
  • Native PostgreSQL Access
  • 16版本和更高版本
    Native SQLite Access
    16新版本
    Native SQLite Access
    Native SQLite Access
  • Native xBase Access
  • Native XML Access
  • Any database via OLE DB (or ODBC via OLE DB)
Notes:
  • From the global code of an MDI parent window, you cannot access a query run in a child window with an independent HFSQL context, even if the data source used is global to the project.
  • All the Native Accesses support the independent HFSQL contexts. However, the copy of context is not supported by some Native Accesses: you have the ability to start and perform a browse in the independent contexts. But you cannot continue in a new context a browse started in a first context.
Indeed, the source variable used refers to the current HFSQL context. Depending on the location where this variable is used, the HyperFileSQL context can or cannot recognize this data source.

Transactions and independent HFSQL context

When copying a context, if a transaction is in progress on the first context, the new context is not in transaction. You must call H事务开始 to start a transaction in the new context.

Limitation: Data files in 5.5 format and views in Hyper File 5.5 format

  • The independent contexts are not supported by the Hyper File 5.5 files.
  • The copy a HFSQL context (creation of an independent HFSQL context from the existing context) fails if a Hyper File 5.5 view (H创建视图_55) is found in the initial HFSQL context.

Limitations: RPC and independent HFSQL context

The access to a HFSQL file via RPC is not allowed from a window or from a report with an independent context.

The "Independent HyperFileSQL context" option must be disabled.

To disable this option:

  • In a window: In the "Details" tab of the window description, uncheck "Independent HyperFileSQL context".
  • In a report: In the "Data" tab of the report description, uncheck "The execution of the report does not affect the browse operations (independent HyperFileSQL context)".
The "Independent HFSQL context" option must be disabled.

To disable this option:

  • In a window: In the "Details" tab of the window description, uncheck "Independent HFSQL context".
  • In a report: In the "Data" tab of the report description, uncheck "The execution of the report does not affect the browse operations (independent HFSQL context)".

In an application that is using the remote access, if independent contexts must be used, they must be programmed by H保存位置 and H还原位置.

Note: The contexts cannot be copied in RPC. You must use H打开数据模型 or H连接远程访问 in the new context to access the RPC.

Limitation: Independent HFSQL context and use of an ODBC driver

Caution: the query will be duplicated only if the copy of the context (window or report opening) is performed ONCE the browse was initialized by SQL第一个.

Not to do
如果SQL执行"Query1"),那么
打开WIN_Result
结束
Do
如果SQL执行"Query1"),那么
SQL第一个"Query1"
打开WIN_Result
结束

HFSQL contexts and windows

How to manage the HFSQL context of a window?

To manage (or not) the independent HFSQL context of a window:
  1. Display the window description.
  2. Display the "Details" tab.
  3. Check (or not) "Independent HyperFileSQL context".Check (or not) "Independent HFSQL context".

If the HFSQL contexts are not independent for each window (option not checked)

Whenever a window is opened, the HFSQL context is updated according to the operations performed in the window.

All the windows work on the same HFSQL context.

If the same window is opened several times in parallel in the application, the HFSQL contexts may overlap and the data used may not correspond to the expected data.

If the HFSQL contexts are independent for each window (option checked)

The current HFSQL context is entirely copied whenever a new window is opened. You can perform different operations (filters, sorts, searches) on the same file, in windows opened in parallel. Each window has its own context. There is no risk of mixing up data.

Each HFSQL context is independent, the record locks can be managed in each context. Closing a window with an independent context:

  • automatically unlocks the records locked by this window,
  • will close the independent context.
Furthermore, a HFSQL function used in a context will have no effect outside this context. Therefore, if the memo management is enabled when opening the independent contexts, you have the ability to disable this feature in a window: disabling the memos will only be performed in the context corresponding to the window.

HFSQL contexts and reports

How to manage the HFSQL context of a report?

To manage (or not) the independent HFSQL context of a report:
  1. Display the description of the report ("Description" from the popup menu of the report).
  2. In the "Data" tab, check (or not) "The report execution does not affect the browses (independent HyperFileSQL context)".In the "Data" tab, check (or not) "The report execution does not affect the browses (independent HFSQL context)".

If the HFSQL contexts are not independent for each report

Whenever a report is printed, the HFSQL context is updated according to the operations performed in the report. All the reports currently printed use the same HFSQL context.

If several reports simultaneously browse the same file, we recommend that you use independent HFSQL contexts.

If the HFSQL contexts are independent for each report

The current HFSQL context is entirely copied whenever a new report is printed. This allows you to perform different operations (filters, sorts, searches) on the same file, in reports opened in parallel. Each report has its own context. There is no risk of mixing up data.
另见