Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21194

Set the Database Path for Crystal Report at Run-Time

$
0
0
Hi,

I am trying to set the Database Path for Crystal Report at run-time. I am using VB 6, CR 9 and Access 2003.
My code is as under but it is giving an error on red line.
Code:

Dim Report As New CrystalReport1

Private Sub Form_Load()
    Report.Database.Tables(1).Location = App.Path & "\Database\InveSys.mdb"
    Screen.MousePointer = vbHourglass
    CRViewer91.ReportSource = Report
    CRViewer91.ViewReport
    Screen.MousePointer = vbDefault

End Sub

Private Sub Form_Resize()
    CRViewer91.Top = 0
    CRViewer91.Left = 0
    CRViewer91.Height = ScaleHeight
    CRViewer91.Width = ScaleWidth

End Sub

Error is
"Logon failed." Details : "Ado error Code 0c80030020"
Source: Microsfot OLE DB Componenets.
Description: A share violation has occured

Please help

Viewing all articles
Browse latest Browse all 21194

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>