Hi,
I have an sql app which connects to the db's via odbc. I have a report within the app that i can run fine on the development pc but when i move to another pc i get the LOGON FAILED message. What am i doing wrong?
here is the code that calls the report and applies the logon details.
Private Sub Print_POReport()
dlgORpt = New frmPOrderRpt
rpt_logon(dlgORpt.rptPorder1)
dlgORpt.rptPorder1.SetParameterValue("dwOrderId", DGVOrders.CurrentRow.Cells.Item("dwOrderId").Value)
dlgORpt.ShowDialog()
End Sub
Private Sub rpt_logon(ByVal CryRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument)
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
For Each myTable In CryRpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.ServerName = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\POP_" & General.Connex, "SERVER", "W2k3server")
myLogin.ConnectionInfo.DatabaseName = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\POP_" & General.Connex, "DataBase", "POP")
myLogin.ConnectionInfo.Password = "pwd"
myLogin.ConnectionInfo.UserID = "user"
myTable.ApplyLogOnInfo(myLogin)
Next
End Sub
The login dialog that crystal corectly identifies the server, database and the userid - just prompts me for the password which i know i have entered 100% correctly. Even when i enter the password there the logon still fails.
I am using vb.net2005
Thanks,
I have an sql app which connects to the db's via odbc. I have a report within the app that i can run fine on the development pc but when i move to another pc i get the LOGON FAILED message. What am i doing wrong?
here is the code that calls the report and applies the logon details.
Private Sub Print_POReport()
dlgORpt = New frmPOrderRpt
rpt_logon(dlgORpt.rptPorder1)
dlgORpt.rptPorder1.SetParameterValue("dwOrderId", DGVOrders.CurrentRow.Cells.Item("dwOrderId").Value)
dlgORpt.ShowDialog()
End Sub
Private Sub rpt_logon(ByVal CryRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument)
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
For Each myTable In CryRpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.ServerName = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\POP_" & General.Connex, "SERVER", "W2k3server")
myLogin.ConnectionInfo.DatabaseName = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\POP_" & General.Connex, "DataBase", "POP")
myLogin.ConnectionInfo.Password = "pwd"
myLogin.ConnectionInfo.UserID = "user"
myTable.ApplyLogOnInfo(myLogin)
Next
End Sub
The login dialog that crystal corectly identifies the server, database and the userid - just prompts me for the password which i know i have entered 100% correctly. Even when i enter the password there the logon still fails.
I am using vb.net2005
Thanks,