Database in Crystal Report 8.5 sometimes do not refesh ?

04-14-2004, 08:34 PM

I'm use VB6.0 to do input form, MS. Access 2000 as Database and Crystal Report 8.5 is Report.

Everything are alright, but sometimes I find out Crystal Report do not refesh database although I used Report.Database.Verify method and in Crystal Report I do not choice 'Save Data with Report' Option. I have checked the data in table was alright.

Here is my code in the form which is loading Crystal Report in my VB6.0 Application:

Dim Report As New rptSoChiTietVL
Dim SubReport As Report
Private Sub Form_Load()
Dim sAppPath1 As String
sAppPath1 = App.Path

If Right$(sAppPath1, 1) <> "\" Then sAppPath1 = sAppPath1 & "\database\"

Screen.MousePointer = vbHourglass
Report.Database.Tables(1).Location = sAppPath1 & "IMTransaction.mdb"


Report.txtMonth.SetText "Thałng" & " " & frmGiaVonHangXuat.txtMonth
Report.Text41.SetText frmGiaVonHangXuat.cboPrd

CRViewer1.ReportSource = Report
Screen.MousePointer = vbDefault

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

End Sub

Private Sub Form_Unload(Cancel As Integer)
MdFunctions.ConnectionDb.Execute "Delete * from SoChiTietVL"
MdFunctions.ConnectionDb.Execute "Delete * from Ton_tmp"
End Sub

04-15-2004, 06:22 AM
Make sure you are using the Active Data Driver (ADO) as your report data source. Then, after you do your .Location method, use Report.DiscardSavedData. Then, where do you pass the new recordset to use. If you have no new recordselectionformula or .SetDataSource command to make, use Report.ReadRecords. And since you are using a .dsr report, make sure you set the object = nothing after the report is finished loading, so when the next instance is run, it has a clean slate.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum