cancel
Showing results for 
Search instead for 
Did you mean: 

Why does a "Database Login" window appear when using Crystal Reports 2020?

jmbuhrer3102
Discoverer
0 Kudos

I have a VB.NET 2022 app, I'm using Crystal Reports 2020, MySQL Server 8.0, and have a 64-bit System
DSN (built using MySQL Connector/ODBC 8.3 (64-bit) and the ANSI Driver). I have a form in my program with a
CrystalReportViewer control on it. The "Datasource Location" for the report has been set to the System DSN.
When my code executes the statement that sets my report as a reportsource, a "Database Login" window appears.
My DSN appears grayed out in the Server Name box, my database appears grayed out in the Database box, "root"
appears in the Login ID box, and I am prompted to enter a password. Why is this window appearing, since I
initialized all the necessary parameters in the DSN? Also, if I enter the password for the root user ID,
why does log in still fail? Using an alternate user ID/password fails as well. There is a "Use Integrated
Security" checkbox on the window. It makes no difference if I check the box or not. I've installed the
latest CR for Visual Studio.Net with Service Pack 5. I tried installing MySQL Connector NET 8.3.0 but the
window still appears. How do I fix this problem?  My code follows:

Dim cmd As New MySqlCommand, myAdapter As New MySqlDataAdapter
Dim conMyConn As New MySql.Data.MySqlClient.MySqlConnection
Dim myReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim sReportFile As String, myData As New DataSet

Try
conMyConn.ConnectionString = "server=localhost;port=3306;uid=root;pwd=*********;database=mydatabase;"
cmd.Connection = conMyConn

cmd.CommandText = "SELECT * FROM PROPOSALS"
myAdapter.SelectCommand = cmd
myAdapter.Fill(myData)

sReportFile = "C:\proposals\crProposals.rpt"
myReport.Load(sReportFile)
myReport.SetDataSource(myData)

'generate the report
crvViewProposals.ReportSource = myReport

'set the zoom factor at 100%
crvViewProposals.Zoom(100)

Catch ex As Exception
MessageBox.Show(ex.Message, "Report could not be created", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try

Accepted Solutions (0)

Answers (0)