Crystal Report and Visual Basic 6 - TechRepublic
Question
August 27, 2008 at 03:25 AM
dilumd

Crystal Report and Visual Basic 6

by dilumd . Updated 17 years, 11 months ago

i have develop a salary system, using crystal report 9, visual basic 6 and ms-access.

I added all the crystal reports to the vb and accessing those report through vb using below code.

my problem is after i load a report, connection to the database is still active. (i notice this by looking at the database location, because “.mdb” and “.ldb” files are there). When i close the report then database connection also disconnected. Can someone give me a solution.

is anyone know how to disconnect the data connection in crystal report, after the report loads?

Dim i As Integer
Dim frm As New frmRPT

On Error Resume Next
For i = 1 To Report.Database.Tables.Count

Report.Database.Tables(i).ConnectBufferString
= strConnect (this is the connection string)

Next

Report.RecordSelectionFormula = sSql

Report.PrinterSetup Me.hWnd
frm.Caption = sCaption
frm.CRViewer91.ReportSource = Report
frm.CRViewer91.ViewReport
frm.Show
Screen.MousePointer = vbDefault

This discussion is locked

All Comments