Joined: 03 Jan 2009
Online Status: Offline
Posts: 24
Topic: Logon Failed Posted: 15 Jan 2009 at 5:30am
Hi again.
I am using a basic MS Access database for testing purposes (which is not passworded) and am trying to call an external CR XI R2 report from VB 6. The report is in the same folder as the VB 6 application so its not a path problem.
I continually encounter the dreaded "logon failed" message when trying to .ViewReport
Any ideas?
Here is my code:
Dim CrRep As CRAXDRT.Report
Dim CrApp As New CRAXDRT.Application
-----------------------------------------
Private Sub Form_Load()
varPath = App.Path
ReportName = "Companies.Rpt"
'Set the report file name
Set CrRep = CrApp.OpenReport(App.Path & "\" & ReportName)
'Populate the Report Object with the desired report file
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & varPath & "\" & "CODADBA.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from oas_company order by code"
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
CrRep.ParameterFields(1).AddDefaultValue "ALL"
'Add the Default value "ALL" at the beginning of the parameter
Do Until Adodc1.Recordset.EOF = True
CrRep.ParameterFields(1).AddDefaultValue Adodc1.Recordset.Fields("code").Value
'Add each value of this table field in our recordset to the parameter's list
Adodc1.Recordset.MoveNext
Loop
crViewer1.EnableGroupTree = True
crViewer1.EnableExportButton = True
crViewer1.EnableRefreshButton = True
crViewer1.DisplayGroupTree = False
crViewer1.ReportSource = CrRep
crViewer1.ViewReport '(THIS IS WHERE THE ERROR OCCURS)
crViewer1.Zoom 2
'Send the report object to the Crviewer and view the report.
Set CrRep = Nothing
End Sub
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum