By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,471 Members | 722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,471 IT Pros & Developers. It's quick & easy.

Crystal Reports - Database Login prompt

P: 2
I am updating a C# Windows Application that has two reports created with Crystal Reports in VS 2005. The two exisitng reports work correctly with no problems. However, I have created a third report (this is the first one I have created from scratch) and when I run it either with the debugger or in the production version, I get a Database Login screen dialog box with the Server Name and Database fields protected and already populated with incorrect information. The other two previously existing reports do not have this problem. When I step through it with the debugger, my new report uses the exact same functionality as the two working reports and I am not finding any other differences in the code. Does anyone have any suggestions?

Thanks.
Apr 20 '07 #1
Share this Question
Share on Google+
1 Reply


P: 3
I've had this problem before:

1. Add the SetCrystalLogin Object on your button click or whatever you use to open the Crystal Report.
2. Add the code in 2 to a class and call it with your database info.

---------------------------------------------------------------------------------------

1. SetCrystalLogin(Me.Direct_Mail_Crystal_Object)


2. Shared Sub SetCrystalLogin(ByRef MyCrystal As CrystalReportViewer)
Dim Counter As Integer
For Counter = 1 To MyCrystal.LogOnInfo.Count
With MyCrystal.LogOnInfo(Counter - 1).ConnectionInfo
.ServerName = "SQLA" '"YOURSERVER"
.DatabaseName = "YOURDATABASE"
.UserID = "sa"
.Password = "YOURPASSWORD"
End With
Next Counter
End Sub


This should work.

Erik Roessing
Apr 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.