Results 1 to 5 of 5

Thread: Crystal Report not showing updated data from SQL server

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    2

    Crystal Report not showing updated data from SQL server

    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.

    Code:
    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?

  2. #2
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    Re: Crystal Report not showing updated data from SQL server

    Add in these lines right after Private Sub....

    Code:
        CR.Reset
        CR.DiscardSavedData = True
    Hope this helps

  3. #3
    Lively Member
    Join Date
    Jun 2008
    Location
    selangor, Malaysia
    Posts
    71

    Re: Crystal Report not showing updated data from SQL server

    Can I ask u guy Whut is DSN stand for?

  4. #4
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    Re: Crystal Report not showing updated data from SQL server

    DSN = Data Source Name = name of the ODBC driver setup in the control panel

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    2

    Re: Crystal Report not showing updated data from SQL server

    Thank you .. your reply helped me
    Najeeb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width