Skip to Content
0
Former Member
Feb 23, 2011 at 08:08 PM

Database Name

553 Views

Hello everyone,

I'm designing a series of reports that are to run against a number of databases (not all at once, just one at a time). Each database has the exact same structure, so it's just a matter of changing the datasource location. The issue that I'm having is that we need to have the name of the database included on the report itself. I don't want to add it as a parameter, as that would open it up to human error.

There are two possible solutions that I can see, but I'm having trouble getting them working...

The first possible solution is to get the database via an sql query. The report already had 1 command to query the data for the report... I've added a second command that queries the name of the database from the MS SQL server. This works fine, unless the main report command returns 0 rows. When that happens, the second command that gets the db name also returns 0 rows, leaving the field blank.

So, is there some way to make commands independant, to ensure that one command always returns results, depite the second command returning zero rows?

The second potential solution is the one that I'm hoping will be possible. I know that there are a number of special fields for each report. (recordcount, etc. ) Is there some way to natively display the name of the database used?

I'd appreciate any help that anyone could offer. Thanks.

- Scott