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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports causes VB progam to crash under Windows 2000

Status
Not open for further replies.

MikeVE

Programmer
Apr 13, 2002
16
GB
My program was written in VB6 with ADO 2.6 and Crystal Reports 8 using TTX files as design datasources. I updated to CR9 because there were problems compiling CR8 under XP. My installation is written with InstallShield Express 4 and uses the Crystal Reports9 Merge Modules.

The problem did not occur with CR8. With the new CR9 version it does not occur under Windows XP. It occurs only when I run it on a clean Windows 2000 machine (a virtual machine using VMWare). When the program tries to set the report data source it crashes with a run time error. The line of code that failed is
Report.Database.SetDataSource rs
where Report is a Crystal Reports report object and rs is an ADO recordset.

The message title is Microsoft Visual C++ Runtime Library. The message text is Abnormal program termination. This occurs when running under Windows 2000 but not under Windows XP.

I constructed a much smaller program using the same techniques to see if I could reproduce the problem and shed any light on it. I thought perhaps there was some kind of corruption within my main program and that I could avoid this be starting from scratch. However the test program showed exactly the same symptoms.

I tried an alternative method of populating the report using
Report.Database.AddADOCommand.
Again this ran happily on the development machine (Windows XP) but failed at this line under Windows 2000. In this case the rte message was failed to load database information - Crdb_ado.dll could not be loaded

Crystal Decisions Knowledge Base suggests this could be because msvcp60.dll is missing but it is present.
InstallShield KB suggests a problem if atl.dll is missing but it is present.

I still think the cause may be some kind of corruption at some stage in the process. I desperately someone with the right expertise to help me understand what is going on and how to put it right. Can anyone help?

 
I have not yet solved this problem but I have made some progress in working out what is going on. I installed VB6, CR8 and CR9 on a new W2K virtual machine. When installing CR9 I used set every componenet to "Instal when needed" except for the RDC for VB developers. I than ran my set up program and then the test program. At the point when the report viewer had displayed and the data was needed the CR9 installer kicked in to install whatever was missing and after that the program ran OK. So the problem now seems to be that the setup produced under WinXPby InstallShieldExpress and the CR9 merge modules does not contain everything needed to run on W2K.
 
Hi !

I highly recommended upgrade your VB projects to CR8.5. It's more stable and more predictable than CR8. From the very begining CR8 has not been tested for Win2k. After some service packs and monthly hot fixes it works fine (but sometimes has unpredictable crash). I upgrade my project to CR8.5, install SP and monthly hot fixes. Now everything is OK.

Concerning ADO recordsets: to solve your problem you should declare and store recordset an module level or at highest procedure level.
For example:[green]
Code:
Private Sub A()
 Dim oReport as CRAXDRT.Report
 ...
 B oReport
end Sub
Private Sub B(ByRef p_oReport as CRAXDRT.Report)
 Dim oRecordset as ADODB.Recordset
 ...
 oReport.Database.SetDataSource oRecordset
 SET oRecordset = Nothing
End Sub
[/green]Cause crash near statemt "end Sub" of procedure A.
[green]
Code:
Private Sub A()
 Dim oReport as CRAXDRT.Report
 Dim oRecordset as ADODB.Recordset
 ...
 B oReport, oRecordset
end Sub
Private Sub B(ByRef p_oReport as CRAXDRT.Report,
 p_oRecordset as ADODB.Recordset)
 ...
 oReport.Database.SetDataSource p_oRecordset
 SET oRecordset = Nothing
End Sub
[/green]
At my case such solution solved problem.

Please note that CR 8.5 don't have such problems.
 
Thanks for your reply FoxBOA. My app is in CR9. I mentioned that it started in CR8 to give the history as I wondered if the upgrade might be a factor.

In the full version of the prog the recordset is declared as a global. In the smaller test version of the program it is a module level object. In both cases the result is the same - success in Win XP & Me but a crash in Win98 & 2K.

Mike
 
Problem solved
After much work with CR support and the Modules program I got from them. I included the following files in the distribution
comres.dll
msctf.dll
sxs.dll
uxtheme.dll
I need to do some more homework to find out exactly what these files do and if they are all vital. Why they are not already in the CR Merge modules defeats me.
I had already included mscvp60.dll.

Thanks for your replies IVak and FoxBOA

Mike VE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top