crystal report RRS feed

  • Question

  • can someone help me how to connect the database dynamically in report from vb.

    I have created one report in which i have to select database & then the fields to display.

    but when i run it on other PC's "Unable to open database" error occurs.

    So I think to connect the database from vb in reports.

    Reply please.....

    Friday, March 9, 2007 5:22 PM

All replies

  • while building crystal report the database should not open in ms-access
    Saturday, March 10, 2007 8:38 AM
  • Option Explicit
    Public Report As New CRClientWiseSummaryReport

    Private Sub Form_Load()
        On Error Resume Next
        Screen.MousePointer = vbHourglass
        Report.Database.Tables(1).SetSessionInfo "", Chr(10) & "password"
        Report.Database.Tables(1).Location = App.Path & "\Sanket.mdb"
        CRViewer1.ReportSource = Report
        CRViewer1.Zoom 1
        Screen.MousePointer = vbDefault
    End Sub

    Private Sub Form_Resize()
        On Error Resume Next
        CRViewer1.Top = 0
        CRViewer1.Left = 0
        CRViewer1.Height = ScaleHeight
        CRViewer1.Width = ScaleWidth
    End Sub


    Monday, March 12, 2007 6:48 PM
  • thank u for reply.

    I will try it out.

    Monday, March 12, 2007 6:53 PM
  • please mark my reply as answer if you've got answer to your doubt.
    Saturday, March 17, 2007 10:11 AM