
Automation Server: CR 6 with VB 6
I'm attempting to use the
Crystal Report Automation Server (version 6)
within a VB version 6 app to print/preview my reports. All works fine
except that I cannot seem to get the Automation Server to accept values for
my SQL Server 6.5 stored procedures. That is, my reports appear fine but my
parameters are ignored. When I try to debug.print the Crystal parameters I
have set I get an 'Out of memory' error from VB. Should I avoid using the
Automation Server method for reports and revert to using the OCX?? Has
anyone managed to get the VB/SQL Server parameterised stored
procedures/Crystal combination to work for the Automation Server?
Here's my code (simplified):
Dim crApplication As CRPEAuto.Application
Dim crReport As CRPEAuto.Report
Set crApplication = New CRPEAuto.Application
'... Do some connection stuff here for SQL Server...
'
Set crReport = crApplication.OpenReport(App.Path & "\Myreport.rpt")
crReport.Database.Parameters.Item(1).Value = "1"
'No error reported here
Debug.Print crReport.Database.Parameters.Item(1).Name 'No
error reported here
Debug.Print crReport.Database.Parameters.Item(1).Type 'No
error reported here
Debug.Print crReport.Database.Parameters.Item(1).Value 'Uh
oh, VB says "Out of memory"
'....then preview, etc
--
Graeme Robertson
Windows Developer
WestpacTrust
New Zealand