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!

Run-time Error '429' from VB6, CR8.5

Status
Not open for further replies.

alhamil5

Programmer
Feb 20, 2003
19
US
I've written a tiny VB6 standard .exe that calls a Crystal Reports version 8.5 report, exports it to .pdf format and saves it to a disk file. The .exe runs on the Crystal Server machine, there is no client-side code or client-side installation. When I launch it from a DOS prompt on my own, Win NT 4 PC, the exe runs fine. But if I launch it with the same command line from any other PC I get "Run-time error 429: ActiveX can't create component'. I've already verified that all the DLLs referenced by my exe are on the Crystal Server and are the same version as my own PC. What could the problem be? Thanks in advance for any help. Here's my code:

'*************************************************************
'SET THE REPORT OBJECT
'*************************************************************
Dim varFolder As String
varFolder = "PL1302153"

Dim crxApplication As CRAXDRT.Application
Set crxApplication = New CRAXDRT.Application '<----fails here
Dim crxReport As CRAXDRT.Report
Set crxReport = crxApplication.OpenReport(App.Path & &quot;\SPL.rpt&quot;)
Dim crxSubreport As CRAXDRT.Report
Set crxSubreport = crxReport.OpenSubreport(&quot;Is_Was_sub.rpt&quot;)

crxReport.Database.SetDataSource Read_Text_File_Main, 3, 1

crxSubreport.Database.SetDataSource Read_Text_File_Sub, 3, 1

'************************************************************
'SET .PDF PARAMETERS AND OPTIONS '*************************************************************
'specify pdf format for output file
crxReport.ExportOptions.FormatType = crEFTPortableDocFormat

'specify output destination as disk file
crxReport.ExportOptions.DestinationType = crEDTDiskFile

'Assign the export file name and location
crxReport.ExportOptions.DiskFileName = varFolder & &quot;/&quot; & varFolder & &quot;.pdf&quot;

'Set option to export all pages of report to .pdf file to true
crxReport.ExportOptions.PDFExportAllPages = True

'*************************************************************
'RUN THE EXPORT
'*************************************************************
crxReport.Export (True)

'*************************************************************
'CLOSE THE APPLICATION WINDOW, SHUT DOWN
'*************************************************************
Unload Me
End Sub

Private Function Read_Text_File_Main() As ADODB.Recordset
Dim rsMain As ADODB.Recordset
Set rsMain = New ADODB.Recordset
Dim connMain As ADODB.Connection
Set connMain = New ADODB.Connection
connMain.Open &quot;DRIVER={Microsoft Text Driver (*.txt; *.csv)}&quot; & _
&quot;;DBQ=&quot; & App.Path & &quot;\&quot; & varFolder & &quot;\&quot; & _
&quot;;DefaultDir=&quot; & App.Path & _
&quot;;Uid=Admin;Pwd=;&quot;

rsMain.Open &quot;SELECT * FROM &quot; & App.Path & &quot;\&quot; & varFolder & &quot;\SPL_reportdata.csv&quot;, connMain, adOpenStatic, adLockReadOnly, adCmdText
Set Read_Text_File_Main = rsMain
Set rsMain = Nothing
Set connMain = Nothing
End Function

Private Function Read_Text_File_Sub() As ADODB.Recordset
Dim rsSub As ADODB.Recordset
Set rsSub = New ADODB.Recordset
Dim connSub As ADODB.Connection
Set connSub = New ADODB.Connection
connSub.Open &quot;DRIVER={Microsoft Text Driver (*.txt; *.csv)}&quot; & _
&quot;;DBQ=&quot; & App.Path & &quot;\&quot; & varFolder & &quot;\&quot; & _
&quot;;DefaultDir=&quot; & App.Path & _
&quot;;Uid=Admin;Pwd=;&quot;

rsSub.Open &quot;SELECT * FROM &quot; & App.Path & &quot;\&quot; & varFolder & &quot;\IS_WAS.csv&quot;, connSub, adOpenStatic, adLockReadOnly, adCmdText
Set Read_Text_File_Sub = rsSub
Set rsSub = Nothing
Set connSub = Nothing
End Function

Private Sub Form_Unload(Cancel As Integer)
'Set the objects to 'Nothing' to remove them from memory.
'This ensures that each time you use these objects
'they are recreated and populated with new data.

Set crxReport = Nothing
Set crxSubreport = Nothing

End Sub
 
Synapse - thanks for your reply. When you say you suspect it's a problem with unregistered DLLs, do you mean unregistered on the Crystal Server machine? I would think that unregistered DLLs on the Crystal Server machine would cause the .exe to fail no matter where I launch it from, but that's not the case.

If you're saying that certain DLLs must be registered on each client machine that runs my .exe then that's a problem since there isn't supposed to be any client-side installation. Everything is supposed to run on the Crystal Server.
 
Try running the .exe from another pc and see if it fails. I suspect it will as the .exe is going to be trying to instantiate an instance of RDC which it is probably going to be trying to do client side.

Since the file does not exist...no go and boom you get the error.

Running form your pc might be not be solid testing as you will likely have CR installed and the dll's can all execute.

Creating a server based app is not always as simple as dropping the .exe on a remote machine and going for it.

Here is a link to a tool you can use to see where the dll's are loading from on your pc as well as compare to the other pc and what dll's are not loading.




Cheers,

SurfingGecko
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top