PC SOFT

WINDEV的在线文档

  • Overview of remote access
  • Benefit of remote access
  • Using the remote access with HFSQL
  • How to use the remote access on HFSQL Classic?
  • Operating mode
  • Configuring the RPC server
  • Server supplied by default
  • Creating a custom RPC server to access a HFSQL database
  • Configuring the server
  • Configuring the RPC client
  • Configuring the client
  • RPC client application
  • Files that must be supplied with the RPC client application
  • RPC on HFSQL: WLanguage functions
  • WLanguage functions for managing the remote access
  • Functions that can be used in remote access
  • Notes
  • RPC and independent HFSQL context
  • Hosting a RPC server created with WinDev 5.5/WebDev 1.5 and a RPC server created with a later version
  • Handling files in 5.5 format
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

Remote access (RPC on HFSQL)

Overview of remote access
The RPC access (Remote Procedure Call) is used to perform punctual accesses to a HFSQL Classic database via Internet/Intranet or via STN (Switched Telephone Network). However, if you want to perform an important number of accesses to the database, you will get better performances by using a HFSQL Client/Server database.

The RPC access also allows you to directly access a HFSQL Classic database or an external database (Oracle, SQLServer, MySQL, ...) from a mobile device, ...

This operation is transparent for the WinDev or WebDev applications ; all you have to do is open the analysis on the remote computer with H连接远程访问 (or H打开数据模型).

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

Benefit of remote access

Different users often need to access the same database. When these users are located on a single site, they use a "standard" network application. For the remote users without direct access to the company network, a specific Internet/Intranet development is required.

Managing the HFSQL Classic data by remote access allows you to use the Internet/Intranet network (or STN) without any specific development.

Using the remote access with HFSQL

How to use the remote access on HFSQL Classic?

The following operations must be performed in order to use the remote access on HFSQL Classic:
  1. Configure the RPC server.
  2. Configure the RPC client application.
  3. Use the HFSQL functions available for the RPC on HFSQL.
  4. Optimize the remote access.

Operating mode

As soon as a remote analysis is opened by H连接远程访问, all the HFSQL commands are sent to the HFSQL library (WDXXXHF.DLL) of the server.

To reduce the network traffic, the commands that do not directly affect the database are run locally. The HFSQL library (WDXXXHF.DLL) and the description of the analysis (".WDD" file) must both be found on each client computer.

The exchanges of data will be performed via the RPC protocol (Remote Procedure Call) by using the functions of the WDXXXCOM.DLL communication library (found on the server) and on the client computer.

Configuring the RPC server

Server supplied by default

A RPC server is supplied with the product. This server corresponds to the WDRemoteAccessServer program. This server can be used as RPC server for HFSQL. This server is supplied in the program directory of the product used.

This server is used to configure:

  • the users allowed to use the RPC server on HFSQL.
  • the HFSQL analyses accessible by the RPC server on HFSQL.
To redistribute the RPC server, you must:
  1. Open the project containing the analysis that must be made accessible by RPC.
  2. Select "Workshop .. RPC server .. Create the setup procedure of the RPC server". The setup wizard starts automatically.
    Note: To access this option, use:
    • The icons
    • The main menu accessible via the product logo:

WinDevHFSQLHF 5.5

Creating a custom RPC server to access a HFSQL database

During a remote access to a HFSQL database, the data is accessible via a WinDev RPC server program. This program must use:Note: The WdRpcsrv.ini file must always be found in the current directory. If the RPC server program changes the current directory, don't forget to move the WdRpcSrv.Ini file into this new directory (reminder: the current directory is returned by 文件当前目录).

Configuring the server

To dialog with the clients and the HFSQL database, the server must be equipped with:
  • a 32-bit system,
  • the TCP/IP network protocol,
  • a WinDev RPC server program (or WDRemoteAccessServer).
  • the HFSQL database,
  • the description file of the analysis (".WDD" file).
Furthermore, the WinDev or WebDev RPC server requires at least:
  • the wdxxxcom.dll library in order to use the communication functions,
  • the wdxxxhf.dll library in order to access the functions for HFSQL management,
  • the description file of the analysis (".WDD" file) in order to access the relevant database,
  • the WdRpcsrv.ini file that contains the connection rights granted to the users. This is a text file that is found in the same directory as the RPC server. It must contain a "password" section in which each entry point is a user name:
    [Passwords]
    UserName1=Password1
    UserName2=Password2
    UserName3=Password3
    ...
  • a specific section in the "Win.ini" file. This section must have the same name as the description file of the analysis. It contains entry points used to localize the data files and the description file of the analysis.
    [AnalysisName.wdd]
    REM Directory of the files defined in the analysis
    REM in the program directory (<?>)
    REPPROG=D:\AppDir\RpcApp\HFData
    REM Full name of the description file
    REM of the analysis (.wdd)
    SUBSTWDD=D:\AppDir\RpcApp\HFData\AnalysisName.wdd
    REM Equivalent to SubtDir, for the files whose
    REM the directory is specified
    REPFIC_C:\WWProject\AppName|Dir1=D:\AppDir\RpcApp\HFData\Dir1

    Note: The lines starting with "REM" are comments and they are useless.
Notes:
  • The server must be accessible by all the client computers (via TCP/IP).
  • To be accessible, the server must be started.
  • The same user can connect several times simultaneously to the server.

Configuring the RPC client

Configuring the client

To dialog with a RPC server and to access a remote HFSQL database, the client computer must have:
  • a WebDev, WinDev or WinDev Mobile program (RPC client application).
  • the description file of the analysis (".WDD" file).
  • the TCP/IP network protocol.

RPC client application

To open the remote data files, the RPC client application must use:
  • H打开数据模型:
    H打开数据模型(<FullNameWDDInLocal>, <AnalysisPassword>, ...
    <ServerIPAddress>, <RPCUserName>, <RPCPassword>)

    The use of this function requires to:
    • have the description file of the analysis (.WDD file identical to the one found on the server).
    • know the password of the analysis (if any).
    • know the IP address of the server (or its DNS name, ex: www.windev.com).
    • have a name and a password recognized by the remote RPC server.
  • H连接远程访问 (recommended)
    H连接远程访问(<Server Address> ...
    [, <User Name> [, <User Password> ...
    [, <Path of .WDD> [, <Password>]]]])

    The use of this function requires to:
    • know the IP address of the server (or its DNS name, ex: www.windev.com).
    • have a name and a password recognized by the remote RPC server (by default, user: ANONYMOUS and password: HYPERFILE.
    • have the description file of the analysis (.WDD file identical to the one found on the server).
    • know the password of the analysis (if any).
By default, these functions use the following parameters:
  • Port used for the RPC: 5001
  • Unencrypted data
  • No security key
  • Optimized response time for Intranet.
To modify these parameters, initialize the variables of the HRPC structure before using H打开数据模型 or H连接远程访问:
HRPC.端口IntegerUsed to specify the connection port used by RPC on HFSQL (default value: 5001). The RPC server and RPC client must use the same port.
HRPC.加密Boolean
  • to encrypt the data handled by RPC,
  • otherwise (default value).
Caution: If the data must be encrypted, it must be encrypted both on the RPC server and on the RPC client, for the same connection port.
HRPC.安全键Character stringUsed by the client to authenticate during the connection to the RPC server. This key must be specified both on the RPC server and on the RPC client for the same connection port. By default, this key corresponds to an empty string.
HRPC.响应时限IntegerResponse time-out for the exchanges between the server and the RPC client. This parameter corresponds to:
  • the INTERNET constant,
  • the INTRANET constant (default value),
  • the time-out in milliseconds.
This time-out must be specified on the RPC client only.
This time-out is a connection time-out (if the connection takes too long, low bandwidth between the client and the server for example).
HRPC.页面大小IntegerUsed to define the number of records (by default) to retrieve for a page of data coming from a view or from a query.

To specify a standard Internet page size, use the h大小.互联网页面 constant.
To specify a standard Intranet page size, use the h大小.内联网页面 constant.
(This parameter corresponds to the <Page Size> parameter of H创建视图)

WinDev Note: If you are using a modem, before the call to H打开数据模型:
  • the connection must be already established with the server (by 网络打开远程访问 for example),
  • the remote RPC server program must be enabled.

Files that must be supplied with the RPC client application

Furthermore, the WinDev/WebDev client computer must have:
  • the wdxxxcom.dll (or wpxxxcom.dll) library in order to use the communication functions,
  • the wdxxxhf.dll (or wpxxxhf.dll) library in order to access the functions for HFSQL management,
  • the wdxxxvm.dll (or wpxxxvm.dll) library in order to access all the functions required by the executables.
Note: Installing the client computer: When generating the setup of the client application, make sure that the .WDD file corresponding to the analysis used is selected.

RPC on HFSQL: WLanguage functions

WLanguage functions for managing the remote access

H连接远程访问Opens an analysis in HFSQL Classic format via a remote access (this function is equivalent to the second syntax of H打开数据模型).
H管理远程访问Temporarily disables the remote access in order to access HFSQL Classic data files found locally.
H打开数据模型Opens an analysis in HFSQL Classic format.

Functions that can be used in remote access

The HFSQL functions can be used when accessing a database by remote access.

The following functions are not available for the remote access:

H记录日期Returns the date and time of the last write operation performed on a record found in a HFSQL file (Classic or Client/Server).
HDB创建Ends the description of the structure of the xBase data file by programming.
HDB描述数据库表Describes by programming a file in dBase3 format (most common format).
HDB描述索引Describes by programming the different index files that will be created.
HDB描述字段Describes by programming each item of the structure of an xBase file described by HDB描述数据库表.
HDB索引Opens an xBase index file.
HDB打开Opens the xBase data file and the "memo" file if it exists.
HDB打开而不加锁In single-user mode, opens an xBase data file without locking it.
HDB排序类型Returns or modifies the sequence of text items in the xBase files.
H导入数据库表Temporarily imports into the current analysis the description of a file from an existing HFSQL file.
H删除视图Destroys a view that was created beforehand. This function is using the former mechanism of views.
H结束禁止修改Unlocks a file that was locked by the same program with H禁止修改.
H管理日志Enables or disables the management of the log for a logged file.
H管理复制Temporarily disables (or re-enables) the replication.
H副本信息Returns information about the specified replica.
H初始化订阅Initializes the range of automatic identifiers for the description file of a subscriber replica (".RPL" extension).
H禁止修改Forbids all the modifications on a data file (for all the programs, including the one that requested the no-modification policy).
H日志信息Adds comments into the log when saving the logged operation.
H日志重建Used to re-create an empty log.
H日志重启Restarts the log process on a file.
H日志停止Stops the log process of a file.
H打开连接Establishes a connection to a specific database.
H计算机Stores a unique computer number or identifier in order to use the logs and the transactions.
H准备SQL查询Initializes a query written in SQL language and declares this query to the database server in order to optimize the next executions of this query.
H重建数据库表Regenerates a data file from its log.
H当前重建索引Indicates that a reindex operation is currently performed on a HFSQL data file and returns the percentage of reindexing already performed.
H复制声明关系Declares a (1,1) (0,n) link between two tables.
H复制过滤器过程Defines the WLanguage procedure that will be called whenever a replication operation is performed on a specific file.
H统计的日期Returns the date of the last update for the index statistics.
H统计的时间Returns the time of the last update for the index statistics.
H替换目录Associates the data directory specified in the analysis with a directory found on disk.
H同步副本Synchronizes the master replica and the subscriber replica: the operations performed on one of the replicas are transferred into the other replica.
H检查结构Defines the mode for comparing the data files.

Caution:
  • The h.使用过滤器 constant is not supported when using H执行查询.
  • The replication, the log process, the external languages and the thumbnails are not supported.
  • HFSQL Client/Server is not available.

Notes
WinDevHFSQLHF 5.5

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 HFSQL 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)".
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.

WinDevWindowsHFSQLHF 5.5

Hosting a RPC server created with WinDev 5.5/WebDev 1.5 and a RPC server created with a later version

To host, on the same server, a RPC server for Hyper File created with WinDev 5.5/ WebDev 1.5 and a RPC server for HFSQL created with a later version, you need to modify the connection port of the WinDev RPC server and use a port other than port 5001.

To modify the port of the RPC server:

  • use the HRPC.端口 variable on the client computer.
  • on the server:
    • If you are using a custom RPC server, call 网络启动服务器 to specify the server port.
    • If you are using the WDRemoteAccessServer application supplied with WinDev, disable the port 5001 ("Configuration" option, "Ports" tab, select line 5001 and click the [Stop] button).

WinDevWindowsHFSQLHF 5.5

Handling files in 5.5 format

To handle a HFSQL Classic analysis that is using files in Hyper File 5.5 format, the Hyper File 5.5 analysis (".WDD" file) must be copied into the server directory.