Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Database Vendor Code: 18456

I have written a view in SQL server 2005 that shows the current logged in user in the pc and I am using a crystal report to that uses this view to show the results. Everything works ok in the VS2005 code, but the moment I publish the web site and run it, I get the following error

Logon failed.

Details: [Database Vendor Code: 18456 ]Database Connector Error: ' [Database Vendor Code: 18456 ]'Logon failed.Error in File Report1 {E519B136-0B07-4E41-99AD-639E0AEDB03A}.rpt:

Unable to connect: incorrect log on parameters.

Details: [Database Vendor Code: 18456 ]

I checked the logon information and everything is ok. If I run a crystal report that connects to a regular table in SQL server, everything works. I am using the below code to run this, and I am sure that I get the error with where I set the location. If I remove it, I don't get the error, but still it won't connect.

Dim subRepDoc As New ReportDocument()

Dim crSections As Sections

Dim crReportObjects As ReportObjects

Dim crSubreportObject As SubreportObject

Dim crDatabase As Database

Dim crTables As Tables

Dim crLogOnInfo As TableLogOnInfo

Dim crConnInfo As New ConnectionInfo()

Dim dbuser As String = "testuser1"

Dim dbpwd As String = "testpas123"

Dim dbname As String = "Test_data"

Dim dbserver As String = "Test_data"

crDatabase = repDoc.Database

crTables = crDatabase.Tables

For Each crTable As CrystalDecisions.CrystalReports.Engine.Table In crTables

crConnInfo.ServerName = dbserver

crConnInfo.DatabaseName = dbname

crConnInfo.UserID = dbuser

crConnInfo.Password = dbpwd

crConnInfo.Type = ConnectionInfoType.SQL

crConnInfo.AllowCustomConnection = True

crConnInfo.IntegratedSecurity = True

crLogOnInfo = crTable.LogOnInfo

crLogOnInfo.ConnectionInfo = crConnInfo

crTable.Location = "Test_data.dbo." & crTable.Location

crTable.ApplyLogOnInfo(crLogOnInfo)

Next

I tried different ways of setting the location, but received the same result.

crTable.Location = "dbo." & crTable.Location.Substring(IIf(crTable.Location.LastIndexOf(".") > 0, crTable.Location.LastIndexOf(".") + 1, 0))

crTable.Location = crConnInfo.DatabaseName & ".dbo." & crTable.Name

crTable.Location = crTable.Name

Any help is greatly appreciated.

replied

I resolved similar issue. I am interfacing a legacy VB 6.0 application with CR XI R2. In my case the error occurred because user name was in caps in my app and the report was created using a lower case username (sql user). The report is migrated from CR 7.0 to CR XI R2. The user name while interfacing from VB 6.0 to CR XI R2 is case sensitive.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question