Setting Database Credentials

If you have tried to use some of the code samples thus far, you might have found that your reports were failing to run when scheduled. One of the causes of this is a lack of database credentials. Keep in mind that Crystal Reports stores all the connection information for the database inside the report except the password. Therefore, this needs to be set at runtime. The easiest way to do this is to type it in manually in the Crystal Management Console and save it with the InfoObject (shown in Figure 35.4). However, sometimes there are many reports and this manual step becomes unrealistic. In this case, the report's credentials can be set programmatically.

Figure 35.4. Setting database credentials through the Crystal ...

Get Special Edition Using® Crystal Reports® 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.