- Configuring the server for remote access
- Accessing the database
- Using HDescribeConnection and HChangeConnection
- HFSQL functions that can be used in remote access
Connecting to a database via RPC
The remote access allows you to access all types of databases.
To do so, create an analysis accessing the external database via the native accesses or via OLE DB/ODBC. This analysis will be deployed on the server.
Then, a remote access server must be configured on the server.
Configuring the server for remote access
The different steps for configuring the server are as follows:
- Installing the "WDRemoteAccessServer" application on the server.
- The following DLLs of WINDEV framework must be found on the server: wdxxxvm, wdxxxobj, wdxxxhf, wdxxxsql, wdxxxstd, wdxxxcom, wdxxxprn, wdxxxetat, wdxxxoldb, wdxxxmat.dll, wdxxxpnt as well as the WDOutil.wdk component.
- These elements must be copied from the "Programs" directory of WINDEV to the server.
- Starting the "WDRemoteAccessServer" application on the server.
- Selecting the analysis (.wdd file) corresponding to the data accessed via the remote access in the "Analyses" tab ("Configuration" button). This selection is performed in the "WDRemoteAccessServer" application.
- Defining the list of users allowed to access the data via the remote access ("Users" tab of "WDRemoteAccessServer").
- Configuring the following elements if necessary:
- Communication port
- Management of encryption
- Automatic start, ...
- Starting the server. When the server is started, the server for remote access is operational and the connection can be established.
Accessing the database
To access the database via remote access, open the analysis with HOpenAnalysis
. For example:
// Open the remote analysis
HOpenAnalysis("MyAnalysis.wdd", "", EDT_IPAddress, EDT_User, EDT_PWD)
The access to the data is performed by the Hxxx functions:
// Initialize the table
WHILE HOut() = False
Using HDescribeConnection and HChangeConnection
// Connection to the RPC server
HConnectRemoteAccess("192.168.1.1", "User", "UserPassword", ...
HDescribeConnection("MyConnection", "", "", " Server_SQLServer ", "dbo", ...
hNativeAccessSQLServer, hOReadWrite, "")
HFSQL 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:
|HRecordDate||Returns the date and time of the last write operation performed on a record in an HFSQL file (Classic or Client/Server).|
|HDeclareExternal||Temporarily imports into the current analysis the description of a data file from an existing HFSQL data file.|
|HDBCreation||Ends the description of the structure of an xBase data file through programming.|
|HDBDescribeFile||Describes a file in dBase3 format (most common format) through programming.|
|HDBDescribeIndex||Describes through programming the different index files that will be created.|
|HDBDescribeField||Describes through programming each item found in the structure of an xBase file described by HDBDescribeFile.|
|HDBIndex||Opens an xBase index file.|
|HDBOpen||Opens the xBase data file and the "memo" file if it exists.|
|HDBOpenNoLock||In single-user mode, opens an xBase data file without locking it.|
|HDBSortType||Returns or modifies the sequence of text items in the xBase files.|
|HDeleteView||Deletes a previously created view. This function uses the former view mechanism. |
|HEndNoModif||Unlocks a file that was locked by the same program with HNoModif.|
|HSetLog||Enables or disables log management on a file.|
|HSetReplication||Temporarily disables (or re-enables) the replication.|
|HInfoReplica||Returns information about the specified replica.|
|HInitSubscriber||Initializes the range of automatic identifiers for the description file of subscriber replica (".RPL" extension).|
|HNoModif||Forbids all the modifications on a data file (for all the programs, including the one that requested the no-modification policy).|
|HLogInfo||Adds comments to the log when saving the operation.|
|HLogRecreate||Used to re-create an empty log.|
|HLogRestart||Restarts the logging process on a file.|
|HLogStop||Stops the log process of a file.|
|HOpenConnection||Opens a connection to a specific database.|
|HComputer||Stores a unique computer number or identifier in order to use the log and transactions in network.|
|HPrepareSQLQuery||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.|
|HRegenerateFile||Regenerates a data file from its log.|
|HIndexingInProgress||Indicates that a reindex operation is currently performed on an HFSQL data file and returns the percentage of reindexing already performed.|
|HRplDeclareLink||Declares a (1, 1) (0, n) link between two tables.|
|HRplFilterProcedure||Defines the WLanguage procedure that will be called whenever a replication operation is performed on a specific file.|
|HStatDate||Returns the date of the last update for the index statistics.|
|HStatTime||Returns the time of the last update for the index statistics.|
|HSubstDir||Associates the data directory specified in the analysis with a directory found on disk.|
|HSynchronizeReplica||Synchronizes the master replica and the subscriber replica: the operations performed on one of the replicas are transferred into the other replica.|
|HCheckStructure||Defines the mode for comparing data files.|
- 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.
Controls such as Table or Combo Box controls based on data files should not be used. We advise you to create a query used to populate the content of the Table or Combo Box control .
Furthermore, we advise you to display as less data as possible. For example, you should use search criteria instead of displaying an entire list of customers.
The number of "back and forth" connections between the server and the client computer must be limited. It may be better to temporarily store the data on the client computer rather than requesting data from the server (configuration data, list of users, ...).
This page is also available for…