PDA

Click to See Complete Forum and Search --> : Crystal Report not showing updated data from SQL server


najeebnros@gmail.com
Apr 21st, 2008, 05:23 AM
I have to use crystal rerport with VB6.0 to read SQL table, and serve to be chaged dynamically in VB.

I am in a strange situation that my new report file does not show updated data from the server. It displays the data at design time preview.

Private Sub Command1_Click()
CR.ReportFileName = "C:\Progs\NewReport.rpt"
CR.Connect = "DSN = ayaz\ayaz;UID = sa;PWD =;DSQ = LabSoft"
CR.Action = 1
End Sub

This code displays the report, but with static data at the time disign.
if I use Report file as "C:\Progs\OldReport.rpt", it displays updated data.

Please note both are using same SQL Table

Can any one help me?

rasinc
Apr 21st, 2008, 09:33 PM
Add in these lines right after Private Sub....

CR.Reset
CR.DiscardSavedData = True


Hope this helps

hiadan_dan
Jul 15th, 2008, 01:58 AM
Can I ask u guy Whut is DSN stand for?

rasinc
Jul 15th, 2008, 10:22 PM
DSN = Data Source Name = name of the ODBC driver setup in the control panel

najeebnros@gmail.com
Jul 15th, 2008, 11:26 PM
Thank you .. your reply helped me