|
|
|
|
- Overview
- Configuring the ODBC administrator
- Programming
- 1. Opening the connection
- 2. Running queries
- 3. Retrieving the result
- 4. Closing the connection
Native Progress Connector: Programming with SQL functions
Available only with this kind of connection
The use of SQL functions to handle Progress data does not require importing the file structure into the analysis. However, the data must be handled by queries only. The content of Progress files cannot be read directly. Configuring the ODBC administrator To configure the ODBC administrator: - Start the ODBC data administrator (ODBCAD32.EXE) on your computer. To do so, select "Start .. Run" from Windows and type "ODBCAD32.EXE".
- Select the "User database" tab.
- Click the "Add" button.
- Select the ODBC driver for Progress (installed with the client version of Progress).
- Click "Done".
- Enter the name of the Progress data source. This name will be used to identify the Progress database in your WINDEV programs.
- Validate ("OK" button).
1. Opening the connection SQLConnect opens a connection to a Progress database via the Native Connector. The type of database used (PROGRESS in this case) must be passed as parameter to SQLConnect. The database name corresponds to the name of ODBC data source (defined in the ODBC administrator). ConnectionNum = SQLConnect("ProgressDatabase", "sa", "", "", "PROGRESS")
2. Running queries The queries are run by SQLExec. SQLExec expects the text of the SQL query as parameter, as well as the name that will be given to this query.
SQLExec("SELECT LASTNAME, FIRSTNAME, EXTENSION, PHOTO FROM CUSTOMER", "QRY1")
3. Retrieving the result Several methods can be used to retrieve the result: - SQLFirst: Retrieves the result and starts an SQLFirst/SQLCol browse.
- SQLTable: Retrieves the result of the query in a Table control populated programmatically in the WINDEV application or WEBDEV site. The result of the query can be retrieved by partial Fetch.
- SQLFetch: Used to browse the different lines of the query result. The browse performed in the query result is an SQLFetch/SQLGetCol browse.
4. Closing the connection SQLClose is used to close the connection to the database once all the necessary queries have been run.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|