PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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
  • Server configuration
  • Configuration of 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
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
Remote access (RPC on HFSQL)
HFSQLAvailable only with this kind of connection
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 remote 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 totally transparent for the WINDEV or WEBDEV applications, all you have to do is open the analysis on the remote computer with HConnectRemoteAccess (or HOpenAnalysis).
WEBDEV - Server code In WEBDEV, this operation allows you to access a database found on a server other than the server where the WEBDEV site is deployed.
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 HConnectRemoteAccess, all the HFSQL commands are sent to the HFSQL library (WDXXXHF.DLL) of 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 analysis description (".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).
Diagram of RPC operating mode
Windows Mobile These exchanges of data can be performed:
  • by Wi-Fi.
  • by ActiveSync.
  • by GPRS (caution: some phone services do not allow to establish a connection between two computers).
  • by network card.
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 for accessing the drop-down menu icons
    • The main menu accessible via the product logo:
      Options in the drop-down menu
Windows Mobile The RPC server must be installed on a PC.
WINDEVHFSQLHyper File 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:
  • NetStartServer to start the RPC server. By default, the port 5001 is used by the RPC server for HFSQL.
  • NetEndServer to stop this server.
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 fCurrentDir).

Server configuration

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 locate 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.
Configuration of 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:
  • HOpenAnalysis:
    HOpenAnalysis(<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 analysis password (if any).
    • know the IP address of server (or its DNS name, ex: www.windev.com).
    • have a name and a password recognized by the remote RPC server.
  • HConnectRemoteAccess (recommended)
    HConnectRemoteAccess(<Server Address> ...
    [, <User Name> [, <User Password> ...
    [ , <Path of.WDD> [, <Password>]]]])

    The use of this function requires to:
    • know the IP address of 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 analysis password (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 HRPC structure before using HOpenAnalysis or HConnectRemoteAccess:
HRPC.PortIntegerUsed 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.EncryptBoolean
  • True to encrypt the data handled by RPC,
  • False 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.SecurityKeyCharacter 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.TimeoutIntegerResponse 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.PageSizeIntegerUsed 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 hInternetPageSize constant.
To specify a standard Intranet page size, use the hIntranetPageSize constant.
(This parameter corresponds to the <Page Size> parameter of HCreateView)
WINDEV Note: If you are using a modem, before the call to HOpenAnalysis:
  • the connection must already be established with the server (by NetOpenRemoteAccess 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

HConnectRemoteAccessOpens an analysis in HFSQL Classic format via a remote access (this function is equivalent to the second syntax of HOpenAnalysis).
HOpenAnalysisOpens an analysis in HFSQL Classic format.
HSetRemoteAccessTemporarily disables the remote access in order to access HFSQL Classic data files found locally.

Functions that can be used in remote access

The HFSQL functions can be used when accessing a database via remote access.
The following functions are not available for the remote access:
HCheckStructureDefines the mode for comparing data files.
HDBCreationEnds the description of the structure of an xBase data file by programming.
HDBDescribeFieldDescribes by programming each item found in the structure of an xBase file described by HDBDescribeFile.
HDBDescribeFileDescribes a file in dBase3 format (most common format) by programming.
HDBDescribeIndexDescribes by programming the different index files that will be created.
HDBIndexOpens an xBase index file.
HDBOpenOpens the xBase data file and the "memo" file if it exists.
HDBOpenNoLockIn single-user mode, opens an xBase data file without locking it.
HDBSortTypeReturns or modifies the sequence of text items in the xBase files.
HDeclareExternalTemporarily imports into the current analysis the description of a data file from an existing HFSQL data file.
HDeleteViewDestroys a view that was created beforehand. This function is using the former mechanism of views.
HEndNoModifUnlocks a file that was locked by the same program with HNoModif.
HIndexingInProgressIndicates that a reindex operation is currently performed on a HFSQL data file and returns the percentage of reindexing already performed.
HInfoReplicaReturns information about the specified replica.
HInitSubscriberInitializes the range of automatic identifiers for the description file of subscriber replica (".RPL" extension).
HLogInfoAdds comments into the log when saving the logged operation.
HLogRecreateUsed to re-create an empty log.
HLogRestartRestarts the log process on a file.
HLogStopStops the log process of a file.
HNoModifForbids all the modifications on a data file (for all the programs, including the one that requested the no-modification policy).
HOpenConnectionOpens a connection to a specific database.
HPostStores a unique computer number or identifier in order to use the log and transactions in network.
HPrepareSQLQueryInitializes a query written in SQL language and declares this query to the database server in order to optimize the next executions of this query.
HRecordDateReturns the date and time of last write operation performed on a record found in a HFSQL file (Classic or Client/Server).
HRegenerateFileRegenerates a data file from its log.
HRplDeclareLinkDeclares a (1, 1) (0, n) link between two tables.
HRplFilterProcedureDefines the WLanguage procedure that will be called whenever a replication operation is performed on a specific file.
HSetLogEnables or disables the log management for a logged file.
HSetReplicationTemporarily disables (or re-enables) the replication.
HStatDateReturns the date of the last update for the index statistics.
HStatTimeReturns the time of the last update for the index statistics.
HSubstDirAssociates the data directory specified in the analysis with a directory found on disk.
HSynchronizeReplicaSynchronizes the master replica and the subscriber replica: the operations performed on one of the replicas are transferred into the other replica.
Caution:
  • The hWithFilter constant is not supported when using HExecuteQuery.
  • The replication, the log process, the external languages and the thumbnails are not supported.
  • HFSQL Client/Server is not available.
Notes
WINDEVWindows MobileHFSQLHyper File 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 window description, uncheck "Independent HyperFileSQL context".
  • In a report: In the "Data" tab of 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 window description, uncheck "Independent HFSQL context".
  • In a report: In the "Data" tab of 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 HSavePosition and HRestorePosition.
Note: The contexts cannot be copied in RPC. You must use HOpenAnalysis or HConnectRemoteAccess in the new context to access the RPC.
WindowsHFSQLHyper File 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 must modify the connection port for the WINDEV RPC server and use a port other than port 5001.
To modify the port of the RPC server:
  • use the HRPC.Port variable on the client computer.
  • on the server:
    • If you are using a custom RPC server, call NetStartServer 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).
WindowsWindows MobileHFSQLHyper File 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.
Windows Mobile By default, a Windows Mobile application cannot use data files in Hyper File 5.5 format.
However, the remote access allows you to consult a Hyper File 5.5 database via Internet/Intranet or via STN.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment