- Implementation and use conditions
- Install the Webservice supplied by PC SOFT on a server
- Install the files required to access the databases
- Use SQLConnectWS to connect to the database
- Use the SQL functions to handle the database
Accessing a database via a Webservice
The access to a database can be performed via a Webservice.
This operating mode can be used in several cases:
- Access to the databases limited to the HTTP functions.
- Access to an external database (Oracle, SQL Server, ...) from an iOS or Android mobile device.
Implementation and use conditions
Install the Webservice supplied by PC SOFT on a server
The setup program of the Webservice for accessing the databases is provided with WINDEV, WEBDEV and WINDEV Mobile. This program is available in the "INSTALL" subdirectory of the setup directory of the product.
To install the Webservice:
- On the server, run WX27 0PACKRSRV.EXE. This file is located in the "Install\WDServerR" subdirectory of the desired IDE.
- In the wizard:
- Accept the license agreement.
- In the "Choice of modules" screen, select "Install the Webservice for accessing the external databases".
- Specify the setup directory of the elements of the reserved server.
- Specify the URL for accessing the server where the Webservice will be installed. You have the ability to use a secure address. This address will be used during the connection via the Webservice via SQLConnectWS.
- Validate the setup.
- This Webservice must be installed on the server to which the applications that use the external databases will connect.
- The server must be able to access the external databases.
- The setup of the Webservice installs a specific version of the WEBDEV application server. This version is required for the Webservice to operate.
Install the files required to access the databases
The database accessed via the Webservice can be found on any computer. Only condition: this computer must be accessible from the server where the Webservice was installed.
Different elements must also be installed according to the type of database.
Accessing the database via a Native Access
If the access to the external database must be performed via a Native Access, the following elements must be installed on the same computer as the Webservice:
- the corresponding client layer if necessary.
- the libraries of the Native WINDEV or WEBDEV Access used to access the database.
Accessing the database via an OLE DB driver
If the access to the external database must be performed via a OLE DB, the following elements must be installed on the same computer as the Webservice:
- MDAC version 2.6 or later.
- the OLE DB provider corresponding to the database used.
Accessing the database via ODBC
If the access to the external database must be performed via ODBC, the ODBC data source must be configured in ODBC Administrator on the setup computer of the Webservice. This data source must be a "system data source".
Use SQLConnectWS to connect to the database
To connect to the database via the Webservice, all you have to do is use SQLConnectWS
. This function corresponds to SQLConnect
. An additional parameter appears: the URL for accessing the server where the Webservice was installed. This URL corresponds to the URL specified in the wizard for installing the Webservice.
does not connect to the database. This function only checks that the Webservice at the specified address is responding. The connection to the database is established each time SQLExec
is called. In this mode, for each query: the connection is established, the query is executed and the connection is then closed.
: How to find out whether the connection parameters are correct:
You can create a small test program using SQLConnect
to connect to the database. Simply run this program on the server where the Webservice is installed. If the access to the database is correct, the parameters specified in SQLConnect
can be re-used in SQLConnectWS
, by adding the server address.
Use the SQL functions to handle the database
Once connected to the database, the application can handle the data via the SQL functions
This page is also available for…