- Lookup table between the different types of databases, their sources and their databases
- Failure or success of connection
- Connection to an HFSQL analysis
- ODBC and OLE DB: Nesting connections
- Connection to a database using ODBC
- Native MySQL, MariaDB and PostgreSQL Connectors
- Connection to an ISAM database via ACCESS
- Using a connection with NT authentication
- Oracle Native Connector: external authentication management
- SQL query (HExecuteSQLQuery or queries created in the query editor)
SQLConnectWS (Function) In french: SQLConnecteWS Connects the current application to a database that will be queried by SQL through a web service proxy (SOAP). Remarks: - This function requires the setup of a web service for accessing the databases. For more details, see Accessing the databases via a web service.
- This function does not allow access to password-protected data files.
ConnectionNum is int
ConnectionNum = SQLConnectWS("http://MyServer/WDSOAPDB_WEB/", ...
"MS Access 97 Database", "", "", "", "ODBC")
IF ConnectionNum <> 0 THEN
...
ELSE
SQLInfo()
Error("The connection to the data source " + SourceName + ...
" failed." + CR + "Error code: " + ...
SQL.Error + CR + SQL.MesError)
END
SQLDisconnect()
Syntax
<Result> = SQLConnectWS(<Server of web service> , <Source> , <User> , <Password> [, <Database name> [, <Type of database> [, <OLE DB provider> [, <Optional information>]]]])
<Result>: Integer - Connection identifier: this identifier is used by the SQLChangeConnection function.
- 0 if an error occurs. To find out the error details, use SQLInfo.
<Server of web service>: Character string URL for accessing the server where the web service for accessing the external databases was installed. This URL was specified in the wizard for installing the web service. For more details, see Accessing the databases via a web service. <Source>: Character string Name of the data source (also called Data Source Name). If the data source contains several "Databases", you must specify the name of the "Database" used (<Database name> parameter). For more details, see remarks. <User>: Character string Username. This name is optional for some data sources: in this case, use an empty string ("") for this parameter. <Password>: Character string or Secret string Password corresponding to the specified user. This password is optional for some data sources: in this case, use an empty string ("") for this parameter..
New in version 2025Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "Ansi or Unicode string". To learn more about secret strings and how to use the vault, see Secret string vault. <Database name>: Optional character string Name of the database to use. For more details, see remarks.- If this parameter is specified, a dialog box specific to the driver is displayed during the connection. This dialog box may not be displayed according to the driver used.
- If this parameter is not specified, no dialog box is displayed.
<Type of database>: Optional character string Type of database accessed. The types of databases installed on the current computer are returned by SQLListSource. For more details, see the remarks. <OLE DB provider>: Optional character string or constant Name of OLE DB provider used. The most common ones are as follows: | | "Microsoft.Jet.OLEDB.3.51" | Access | "Microsoft.Jet.OLEDB.4.0" | Access | "MSDAORA" | Oracle (Microsoft) | "MSDASQL" | ODBC | "OraOLEDB.Oracle" | Oracle | "SQLOLEDB" | SQLServer | or one of the following constants: | | hODBC | OLE DB provider for ODBC. Allows you to access an ODBC source declared in the ODBC data sources of Windows | hOledbAccess97 | OLE DB provider for Access 97 | hOledbAccess2000 | OLE DB provider for Access 2000 | hOledbAccess2007 | OLE DB provider for Access 2007 | hOledbDBase5 | OLE DB provider for dBase 5 | hOledbExcel97 | OLE DB provider for Excel 97 | hOledbExcel2000 | OLE DB provider for Excel 2000 | hOledbExcel2007 | OLE DB provider for Excel 2007 | hOledbLotus4 | OLE DB provider for Lotus 4 | hOledbOracle | OLE DB provider for Oracle | hOledbSQLServer | OLE DB provider for SQL Server |
Caution: To use an OLE DB connection, you must:
- install MDAC version 2.6 or later (setup performed by WINDEV or WEBDEV when installing the application)
- install the OLE DB provider corresponding to the database used.
<Optional information>: Optional character string (not to be used with HFSQL or direct ODBC) Used to specify the optional information. You can for example specify "Trusted_Connection=YES" in order to use a connection with authentication via the NT login. If several optional information must be specified, they must be grouped in a single character string and they must be separated by the ";" character.
This page is also available for…
|
|
|