I have a database in MS Access.I want to show the details in a crystalreprtviewer.Please tell me the procedure in VB.net to connect the database to the crystalreport.

Drop a viewer in ur form...in ur forms load event try the below code

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

Public Class rptFinance
     Dim oRead As System.IO.StreamReader

 Private Sub rptFinance_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      Dim crtableLogoninfos As New TableLogOnInfos
      Dim crtableLogoninfo As New TableLogOnInfo
      Dim crConnectionInfo As New ConnectionInfo
      Dim CrTables As Tables
      Dim CrTable As Table

      Dim cryRpt As New ReportDocument
      cryRpt.Load(Application.StartupPath & "\Reports\CrystalReport1.rpt") 'Path where ur report is placed

      With crConnectionInfo
           .ServerName = "path wherer ur access database is present"
           .DatabaseName = "path wherer ur access database is present"
           .UserID = ""
           .Password = ""
      End With
      CrTables = cryRpt.Database.Tables
      For Each CrTable In CrTables
           crtableLogoninfo = CrTable.LogOnInfo
           crtableLogoninfo.ConnectionInfo = crConnectionInfo
           CrTable.ApplyLogOnInfo(crtableLogoninfo)
      Next

      crvFinance.ReportSource = cryRpt
      crvFinance.Refresh()

      'crvFinance is the report viewer name
This article has been dead for over six months. Start a new discussion instead.