Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with logon to report db

Status
Not open for further replies.

Appollo14

Technical User
Sep 4, 2003
182
0
0
GB
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,
 
Do you have the exact same odbc connection set up on the other pc as you do on the development pc? If not, that's your problem. This is one of several issues with using ODBC drivers instead of native database drivers.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Hi hilfy,

the other pc's odbc is named exactly the same as the one on the development pc, the difference is the name of the server that the odbc looks at.

Regards,
Noel.
 
Hi,

I think i've found the problem. ME!. I assumed the report was using odbc but when i looked back it was using a project data connection. I have corrected the report and all SEEMS fine. I'll run a few more tests and if i have any more problems i'll post back.

Thanks for taking the time to read the post.

Noel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top