Skip to Content
0
Former Member
Mar 03, 2011 at 09:44 AM

Dynamic Crystal Report with Windows Server 2008

29 Views

I am creating a report through code with Crystal report on Windows Server 2008 R2. When I am executing the following command:

CRAXDRT.Report.Database.AddADOCommand

This is generating an error which is given below:

Error description: Logon failed

Details: [Database Vendor Code: -205]

But its working fine with Windows Server 2003.

Private Sub AddRptDatabase(a_CRReport As CRAXDRT.Report, a_sStartDT As String, _

a_sEndDT As String, a_sDept As String, a_sStatus As String)

Dim cnnRpt As ADODB.Connection

Dim cmRpt As ADODB.Command

Dim sSQL As String

Dim sWhere As String

Dim sTemp As String

Dim sTemp1 As String

sSQL = sSQL & sWhere & " Order by AdminData.RONumber"

Set cnnRpt = New ADODB.Connection

cnnRpt.open g_objBA.LocalConnectionString

Set cmRpt = New ADODB.Command

cmRpt.ActiveConnection = cnnRpt

cmRpt.CommandType = adCmdText

cmRpt.CommandText = sSQL

'Create data set

a_CRReport.Database.AddADOCommand cnnRpt, cmRpt

Exit Sub

Please suggest some solution.