M.I.Sahil 0 Newbie Poster

Aslam o alikum,

I create a report in Crystal report 9 with add command using Oracle 11g as Database with OLE DB (ADO) (Microsoft OLE DB provider for Oracle). It works fine in crystal report. I want to call this report from vb6 form. I m not using any server Machine , (VB6, ORACLE 11g, Crystal report 9 running on same PC(Machine).

the code i m using is as under :

this portion is defined in a Module

Public RptApp As New CRAXDRT.Application 
Public Report As CRAXDRT.Report
Public crxTable As CRAXDRT.DatabaseTable
Public CPProperty As CRAXDRT.ConnectionProperty

This portion is in a VB6 form.

Set Report = RptApp.OpenReport(App.Path & "\Reports\ReportName.rpt")
  For Each crxTable In Report.Database.Tables
       crxTable.SetLogOnInfo "Host-Name", "ORCL", username, userpass
  Next
        Report.EnableParameterPrompting = False
        Report.DiscardSavedData
        Screen.MousePointer = vbHourglass
        frmReport.CRViewer91.ReportSource = Report
        frmReport.CRViewer91.ViewReport
        Screen.MousePointer = vbDefault

When i run the the program it give the error :
Logon Failed,
Details :ADO Error Code 080040e21
Source: Microsoft OLE DB service Components

Can any body let me know what changes should i do. Or what is correct code for.

Thanks in advance