Results 1 to 3 of 3

Thread: Program Crashes while using crystal report

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    2

    Program Crashes while using crystal report

    I am using Crystal Report Version No.: 11.0.0.1282

    My program crashes when I run following lines of code.
    I have created a connection with SQL server database through DSN. I have used following lines of code…

    1 StrSQL= “SELECT Employee.EmpNo, Employee.Name, Employee.Address, EmpSalary.Salary FROM Testing.dbo.Employee Employee LEFT OUTER JOIN Testing.dbo.EmpSalary EmpSalary ON Employee.EmpNo=EmpSalary.EmpNo"

    2 Set rpt = cryApp.OpenReport(“C:\EmpDetails.RPT")
    3 Call Open_RecordSet(StrSQL) ‘assigns recordset value to rs

    4 rpt.DiscardSavedData
    5 rpt.Database.LogOnServer "crdb_odbc.dll", "DSN", "Database", "uid", "pwd"
    6 rpt.Database.SetDataSource rs

    7 FrmCrystal.cryreportviewer1.ReportSource = rpt
    8 FrmCrystal.cryreportviewer1.ViewReport

    9 FrmCrystal.Show vbModal
    10 Set FrmCrystal = Nothing
    11 rpt.Database.LogOffServer "crdb_odbc.dll", "DSN", "Database", "uid", "pwd"
    12 Set rpt = Nothing

    I am getting error when line No. 12 is executed. Program crashes and gives following error message...

    Program.EXE has encountered a problem and needs to close. We are sorry for the inconvenience.

    I have tested various combinations. I have concluded that the error comes when following two conditions meet,

    1) Statement No.5 exists in above code.
    AND
    2) Crystal Report contains field from two different tables.
    AND
    3) Line No 12 is executed.

    Last edited by Smith_Will; May 9th, 2008 at 05:33 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Program Crashes while using crystal report

    Welcome to the forums.

    Is this happening on your developer machine or a machine where you have installed your application?

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    2

    Re: Program Crashes while using crystal report

    This is happening on my testing machine. This is my desktop application and I am just checking on my desktop after creating it. Please help me as soon as possible. Thanks.

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