I have installed a custom VB.Net app on a client's PC. It works fine except for Crystal Reports (surprise). Crystal refuses to connect to the database despite the fact that I specifically point it to the DB. Below is the code used to do this. The appropriate values are passed as global variables (and I have verified that they are the correct values). If anyone can tell me what I an doing wrong, please help!
'Changes the location of the database
Private Function GetTableLogOnInfo(ByRef rpt As CrystalDecisions.CrystalReports.Engine.ReportDocum ent) As Boolean
Dim myDbConn As New CrystalDecisions.Shared.ConnectionInfo()
With myDbConn
.ServerName = gstrCrystalDBServer
.DatabaseName = gstrCrystalDBDatabaseName
.UserID = gstrCrystalDBUserID
.Password = gstrCrystalDBPassword
End With
Dim myTableLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo()
myTableLogonInfo = rpt.Database.Tables(0).LogOnInfo
myTableLogonInfo.ConnectionInfo = myDbConn
rpt.Database.Tables(0).ApplyLogOnInfo(myTableLogon Info)
Dim blnConnectionStatus As Boolean = rpt.Database.Tables(0).TestConnectivity()
If blnConnectionStatus Then
MessageBox.Show("Connection to database was successful!", "Crystal Reports DB Connection test", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return True
Else
MessageBox.Show("Connection to database FAILED!", "Crystal Reports DB Connection test", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Return False
End If
End Function