Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Specifying the Database at runtime

Specifying the Database at runtime

Specifying the Database at runtime

I've been asked to write a Crystal Viewer app since there doesn't appear to be one out there that fulfils the requirements I've been given, one of which it to allow the user to select which database to report against.

Does ANYONE have a clue how to do this???

I'm using the CRAXDRT.Report object (from CR 8.5) to store the report instance, and the CRViewer control to display it.

I've tried modifying the Location property of every Table in the Report's Database object (and then calling the database's Verify method), but I'm still suffering from the "Server has not yet been opened" error.

Answers on a postcard...

Thanks for any help,

Pete Cozens

RE: Specifying the Database at runtime

You're not logging into the database.  It doesn't have anything to do with Set Location inside the report.

Use .LogonServer or .SetLogonInfo.

RE: Specifying the Database at runtime

Sorry - that's not it.

I'm calling the Crystal Application's LogonServer() method, and that part's working fine. If I connect to the same database as was used to develop the report, then the report is displayed correctly. It is just when I try to connect to a different database (with the same schema) that the error message is displayed.

RE: Specifying the Database at runtime

Well, you're still not connecting to the database in some manner.  That's what the error means.  

If you do just a .LogonServer to Database1 and you have a subreport that has a table with a location of Database2.dbo.tablename, then you're going to have a problem. That's why Crystal recommends logging into the main report and every sub-report separately with .SetLogonInfo.

I usually take the easy way out and strip the name of the database off all of the tables in both the main report and subreport using Set Location.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close