Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRViewer / Visual Basic / SubReport Problem - Crashes

Status
Not open for further replies.

PCSAARON

Programmer
Jul 9, 2002
131
US
Just wondering if anyone might know what the problem may be here. I designed a report using Crystal Reports 8.5 and it consists of the main report and a subreport. They are both active data (ADO) connections. The subreport is linked on the main report by an EmployeeID field.

I am passing the record sources in via coding for both report and subreport. I am using Visual Basic V6 and CRViewer to view the reports. When I pass:
"SELECT * FROM TimeCard" in for the Sub Report, the report opens fine without any errors.

When I pass:
SELECT * FROM TimeCard WHERE PunchInDateTime >= '2002-08-13' AND PunchInDateTime <= '2002-08-20'

Visual Basic Crashes when the report goes to open.

Here is the error:
CRViewer: VB6.exe - Application Error
The instruction at &quot;0x06818da0&quot; referenced memory at &quot;0x454c4553&quot;. The memory could not be &quot;read&quot;.

When going to the debugger (C++) it gives this message:

Unhandled exception in VB6.EXE (CRAXDRT.DLL) Access Violation

I think I got this error before, but can't remember how to fix it. Any suggestions? Thanks in advance.

Aaron
 
I used paramter passing instead of passing the RecordSource in, and it did the trick. But I am still curious why you can't pass the SQL statement into the subreport with conditions. Anyone have any comments?

Aaron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top