Invalid TLV Record VB 6.0 CR9

9.7k views Asked by At

I currently am getting the error:

Invalid TLV Record

When running the following block of code:

Private Sub PrinttoFile_Click()
    Dim crApp As CRAXDRT.Application
    Dim crRep As CRAXDRT.Report
    Set crApp = New CRAXDRT.Application
    Set crRep = crApp.OpenReport("C:\Documents and Settings\Administrator\Desktop\DansTest\Report3.rpt")
    '...code to set report parameters, login information etc...

    ExportReportToPDF crRep, "C:\Testing\ReportTest.pdf", "Beds Held"


End Sub

It errors on Set crRep = line. I've made sure that all my .dlls for CR9 are registered. The report was built using CR9 Reports and saved as such. CRAXDRT is the CR9 runtime activeX control. Any ideas?

Also, this is not a deployment issue. I am working on the same machine as the coding. This error is happening while debugging the original code, not while running an executable.

1

There are 1 answers

0
Daniel Camburn On BEST ANSWER

The answer to this problem turned out to be that my CRAXDRT.dll file for CR9 was in the Windows System32 folder. Even though the reference in VB 6.0 was pointing to the correct .dll, something about it was wrong.

I fixed the error by copying the .dll into the folder with the rest of the CR9 files, C:\Program Files\Common Files\CrystalDecisions\2.0\bin and redirected the reference here and it solve the error.

So in short, make sure your dll file is in the correct folder with the rest of the dll files.