Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current Database Connection

Status
Not open for further replies.

BradCustom

IS-IT--Management
Oct 5, 2007
296
US
I was wondering if anyone knows how to show the current (connected) database name on a report.

Thanks for your help!
 
I found how to show the current database connection in Crystal Reports XI.

If you create an SQL Expression and place it in the Page Header then it will display the current database that you are running your report against. In my case I use the same reports for multiple databases so it's important that the database name print on the report.

Here is the SQL Expression:

{fn DATABASE()}
 
However, I think that whether this function is available to you depends upon your datasource. You might want to identify the type of database and the connectivity you are using.

-LB
 
To clearify: I'm using Crystal Reports XI to run reports inside of an application that uses SQL Databases via ODBC.

Perhaps this statment wouldn't work for someone using a different datasourse.

However, it works just fine if your using multiple SQL Databases.

Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top