Kbase P45468: RB. How to use RB-DB-CONNECTION parameter?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/10/2008 |
|
Status: Verified
GOAL:
How to use RB-DB-CONNECTION parameter?
GOAL:
When do I need to specify a value for RB-DB-CONNECTION?
GOAL:
Using RB-DB-CONNECTION with the Report Engine PRINTRB and PRNTRB2 Interfaces
FACT(s) (Environment):
Progress 8.x
Progress 9.x
FIX:
RB-DB-CONNECTION allows you to override the saved database connections by specifying the logical name of the database as saved in the report and all connection parameters Report Engine needs to connect to the database containing the report data. You can specify a string composed of any valid Progress 4GL connection parameters.
Report Builder saves all required database connection information with the report definition (except the password). You need to specify a value for RB-DB-CONNECTION only in three situations:
1) If you want to run a report using a database other than the one saved with the report definition
2) If you want to run a report using the same database that is saved with the report definition, but you are connecting to that database on the command line that invokes Report Engine (or in a .pf file that Report Engine reads on startup)
3) If your database requires a password, and you do not want Report Engine to prompt you for it
Use the logical database name, not the physical database name, when specifying which report databases are to be overridden with the RB-DB-CONNECTION parameter.
If you have security measures such as passwords and user IDs enabled, you must specify the Password (-P) and User ID (-U) parameters or the Report Password (-rbP) parameter if you are using the table interface.
RB-DB-CONNECTION and the Report Engine PRINTRB and PRNTRB2 Interfaces.
When you use the PRINTRB or PRNTRB2 interfaces to the Report Engine, the RB-DB-CONNECTION parameter allows you to override only one database.
In versions of Report Builder before Version 8.0, the parameters in the RB-DB-CONNECTION parameter to PRINTRB do not completely substitute for the full database connection string in the report definition. Instead, Report Engine substitutes them on a connection-parameter-by-connection-parameter basis. Thus, if your report definition specifies the connection information "-db orders -N tcp -H server -S ordersrvc", and the RB-DB-CONNECTION parameter specifies the string "-H newserver", Report Engine uses the connection string "-db orders -N tcp -H newserver -S ordersrvc" when it attempts to establish the database connection. Therefore, it unintentionally prevents you from overriding the previously described report database connection with a new connection string such as "-db c:\mydata\orders -1", because there is no way to eliminate the -H, -S, and -N connection parameters.
Because some users might have utilized this behavior, Report Builder Version 8.0 and greater retains it. However, Report Builder also augments the syntax of the RB-DB-CONNECTION parameter to allow you to completely replace the report database connection information. If you specify the RB-DB-CONNECTION parameter as "orders=-db c:\mydata\orders -1", where the leading "orders=" indications the logical name of the database as specified in the report definition, Report Engine discards all the connection information saved in the report definition and uses only the newly specified database connection parameters.
With the PRINTRB or PRNTRB2 interfaces, you cannot use the "=>" symbol. However, you can use only the "=" symbol. The "=" symbol indicates to establish a new database connection using the specified connection information.
When you use the "=" symbol to specify the database connection information, follow these rules:
· On the left side of the "=" symbol, specify the logical name of the database saved with the report.
· On the right side of the "=" symbol, specify a complete connection string.
For example, if the report definition specifies the physical database as newdb1.db and the logical database name as newdb1, you use the RB-DB-CONNECTION parameter to override the connection information using the following value:
newdb1 = -db newdb3 -1
This value means that when you invoke Report Engine, it will override all the stor.ed database connection information for newdb1 with the information "-db newdb3 -1". The "=" symbol indicates to establish a new database connection using the specified connection information.
For backward compatibility, you can still use the syntax required by earlier versions of Report Builder to override individual parameters. For example, the following value tells Report Engine to simply add the values to the existing connection information stored in the report:
-db newdb3 -S newserver.