Click to See Complete Forum and Search --> : Logon failed while using Command Object.


ajay chani
December 28th, 2005, 04:54 AM
Hi all,
I am new to crystal reports, so hope u won't mind if my problem looks too silly ..
I am using Crystal reports 9 and have created a .rpt file.
For the data selection i am using a sql query in a Command Object and i am also passing a few parameters to the query.
I am trying to use the report from VB6. (using CRViewer9 control).
Here is the code i am using..
______________________________________

Set CRXApplication = New CRAXDRT.Application
Set CRXReport = New CRAXDRT.Report
'CRXReport.Database.LogOnServer
'CRXReport.Database.LogOnServer(" ","scada-srv","orascada","bhopal_scada","oracle")
'CRXReport.Database.LogOnServerEx("","","orascada","bhopal_scada","oracle","","")

strPath = "D:\crys_view\powerParams_minmax.rpt"
CRXReport.Database.Tables(0).DatabaseType = DatabaseTypes=
Set CRXReport = CRXApplication.OpenReport(strPath, 1)

Me.CRViewer91.ReportSource = CRXReport
CRXDatabase = CRXReport.Database
Me.CRViewer91.ViewReport
__________________________________________
When i run i can see the saved data but when i want to refresh ..the viewer prompts for new parameters but then gives the error message "logon failed", this is expected also as i have not given any login information anywhere in the code. But how to pass the login information and where .....

Thanks in advance.