Why does the "Database Login" box keep popping up...and doesn't accept my login credentials

I'm working with a very basic app to learn about putting Crystal Reports in my applications.  I have a Windows application with a single form with a combo box, a button, and a Crystal Report Viewer on it.  I have a very simple Crystal Report that I developed using Crystal 8.5...this report accepts a single parameter. (I want to be able to develop and edit my reports outside of Visual Studio and then link to them from the application so that report changes do not require a program recompile.)

Everything was working fine until, I tried to change the database connection settings for the Crystal Report via program code. Now, when I run the program, I get a "Database Login" dialog box.  This box has the following fields on it:

Table Name: imitmidx_sql (and I can not change this table name..though it is one of the 3 tables the report uses)
Server Name: jamesdell (I can change this, though it is correct)
Database: (this is blank, so I type in 001 which is the database I want to connect to)
Login ID: sa (I can change this, though it is correct)
Password: (this is blank, but is correct for my local SQL Server)

No matter what I do, once I click the Finish button I get, "Logon Failed. Please try again."

Below is the code I'm using to load the crystal report:

Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
            'Load the report
            crReportDocument.Load("C:\Program Files\MSMPC\rpt\MSMOEINV.rpt")

            'Setup the connection information.
            crConnectionInfo = New ConnectionInfo
            With crConnectionInfo
                .ServerName = "jamesdell"
                .DatabaseName = "001"
                .UserID = "sa"
                .Password = ""
            End With

            'Get the table information from the report
            crDatabase = crReportDocument.Database
            crTables = crDatabase.Tables

            'Loop thru all tables in the report and apply the connection information for each table.
            For Each crTable In crTables
                crTableLogOnInfo = crTable.LogOnInfo
                crTableLogOnInfo.ConnectionInfo = crConnectionInfo
                crTable.ApplyLogOnInfo(crTableLogOnInfo)
            Next

            'Set the parameter field definitions
            crReportDocument.SetParameterValue("inv_no", cboInvoices.SelectedItem)

            'Bind the report to the viewer
            CrystalReportViewer1.ReportSource = crReportDocument
End Sub
msmpcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dylanyeeCommented:
I suspect you didn't set your table location properly. try append the table location as below:

For Each crTable In crTables
      crTableLogOnInfo = crTable.LogOnInfo
      crTableLogOnInfo.ConnectionInfo = crConnectionInfo
      crTable.ApplyLogOnInfo(crTableLogOnInfo)
      crTable.Location = crTableLogOnInfo.TableName;
Next

dylan
0
msmpcAuthor Commented:
mlmcc...I looked over the link...I don't know what Report Designer Component 6 is...how do I know what version I'm using...also, if I try to use their code, I get an "is not defined" with the  Craxdrt part in "Dim crTable As Craxdrt.DatabaseTable "

dylan...if I add the line "crTable.Location = crTableLogOnInfo.TableName", my app throws an exception "Invalid table number"
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

dylanyeeCommented:
Do you have subreport in your report? If so, you have to apply the same table logon info the tables in subreport.

dylan
0
msmpcAuthor Commented:
no subreport...I've created the report as simply as I can, just to create a sample project demonstrating how to have a Crystal Report in a vb.net application.  The report has a single parameter and displays one field from each of 3 linked tables. I have an order header, order line, and item table.  I'm trying to show the customer number (from header), item number (from line), and item description (from item) where the invoice number field in the header table (this value is unique in this table) matches the parameter value (taken from a combo box on the form)

I'm beginning to wonder it this is related to the fact that my Crystal Report was created using a Crystal Reports 8.5 and is being linked to the vb.net project with the crReportDocument.Load("C:\Program Files\MSMPC\rpt\MSMOEINV.rpt") statement.  Is there some references or namespaces that must be included for a CR 8.5 report?
0
msmpcAuthor Commented:
ok...problem seems to be solved.  I created the report with Crystal 10 and made no changes to the vb.net code and now it works.  Now that I think of it, seems like I read somewhere on this site that Crystal 8.5 was not supported in .NET.

0
dylanyeeCommented:
CR 8.5 is supported in VS.NET 2002/2003, I am not sure about VS.NET 2005.
If you are using VS.NET 2005, it might not provide backward support for some of the feature in CR 8.5 snice VS.NET 2005 comes together with CR10.

dylan
0
msmpcAuthor Commented:
I'm using VS.NET 2003.  All I can say is, I uninstalled Crystal 8.5 and installed Crystal 10 just out of frustration and now it seems to be working fine.
0
GranModCommented:
Closed, 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.