469,926 Members | 1,552 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

Crystal Reports - Database Login prompt

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?

Apr 20 '07 #1
1 2591
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.

Similar topics

reply views Thread by lilush | last post: by
2 posts views Thread by Chris Ashley | last post: by
12 posts views Thread by Murali via DotNetMonster.com | last post: by
2 posts views Thread by chris.dannemiller | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.