What is a query performed on a connection?
A
query performed on a connection is a query performed on data files handled via a specific ODBC driver or a Native Connector.
When the connection is created, you can define:
- the connection name
- the name of the data source
- the username and password
- the name of the database accessed (if there is more than one).
The report editor allows you to print the data coming from a query performed on a connection. All the parameters of the connection to use can be defined in the report editor or through programming with the WLanguage properties.
ODBCSQLCode is used to:
- Find out the SQL code of the "query performed on a connection" (data source of report). This query is performed on one or more data files accessible via a specific ODBC driver or a Native Connector. This query is defined during the report creation.
- Modify the SQL code of the "query performed on a connection" (data source of report).
Remark: This property must be used in the opening code of the report.
// -- Opening code of the report
RPT_Report1.ODBCConnectionName = "MyConnection"
RPT_Report1.ODBCSQLCode = "Select * from Products"
RPT_Report1.ODBCUserName = "MOORE"
RPT_Report1.ODBCPassword = "PSW"
Syntax
Finding out the code of the "Query performed on a connection" Hide the details
<Result> = <Report used>.ODBCSQLCode
<Result>: Character string
Text of the SQL query to be executed on the database accessed via a specific ODBC driver or a Native Connector. This query must be a Select query (SELECT).
<Report used>: Report name
Name of the report to be used.
Modifying the code of the "Query performed on a connection" Hide the details
<Report used>.ODBCSQLCode = <New SQL code>
<Report used>: Report name
Name of the report to be used.
<New SQL code>: Character string
SQL code of the query to be executed. The SQL code must be recognized by the database used. This query must be a Select query (SELECT).
Remarks
Properties used to manage reports based on data files accessed via an ODBC driver or a Native Connector
The following properties are used to manage reports based on data files accessed via an ODBC driver or a Native Connector:
| |
ODBCConnectionName | Used to identify and change the name of the connection used to handle a database accessed via an ODBC driver or a Native Connector. |
ODBCDatabaseName | Used to identify and change the name of the database used by the query executed on a database accessed via an ODBC driver or a Native Connector. |
ODBCPassword | Used to identify and change the password associated with the user allowed to access a database via an ODBC driver or a Native Connector. |
ODBCSQLCode | Used to identify and change the SQL code of the query executed on a database accessed via an ODBC driver or a Native Connector. |
ODBCUserName | Used to identify and change the name of the user allowed to access a database via an ODBC driver or a Native Connector. |
Limit
The ODBCSQLCode property applies only to the reports based on a "query performed on a connection".