cancel
Showing results for 
Search instead for 
Did you mean: 

How to Capture/Handle "Crystal Report Viewer" Error

ido_millet
Active Contributor
0 Kudos

vb6, winform, rdc, Cr XI R2 application.

The application generates an error message with a title of
"Crystal Report Viewer"

My code already handles testing connectivity, but this scenario involves a database that gets "refreshed" every hour with new data, and can become temporarily unavailable in the middle of processing

In any case, since this error message doesn't come from my code, it must be an unhandled exception within the RDC runtime.:

Question: is there a way to capture & handle this type of unhandled exception using the RDC object model?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Ido

There is nothing in the RDC object model that I can remember. Maybe Don does (he's a spring chicken compared to me...).

I suspect a simple "on error goto" does not do the trick?

- Ludek

ido_millet
Active Contributor
0 Kudos

Hi Ludek,

Thanks for the confirmation. Seems odd that the Crystal runtime has no way to capture such exceptions. But I've seen stranger things when it comes to the Crystal runtime...

former_member183750
Active Contributor
0 Kudos

Yeah. How true.

Error: No Error

Ludek

Answers (1)

Answers (1)

0 Kudos

Hi Ido,

I'm an old Buzzard like Ludek too and I don't recall now if there was any Exception handling in the RDC, Usually you just get the COM Error code...

For querying the DB how about using the TestConnectivity ( or what ever it was called in the RDC ). Should return false if it fails.

For disconnects while getting data that would be tougher....

Sorry it's been so long since I used the RDC I don't recall now...

I think Ludek has the best idea, use the On Error to capture and see if you can drill into the inner exceptions.

Don

ido_millet
Active Contributor
0 Kudos

Hi Don,

The scenario is that TestConnectivity works.  The error message gets triggered after that.

Please clarify: what "On Error" are you referring to?

Cheers,

- Ido

0 Kudos

Oops, missed that part, you already capture it and use TestConnection....

Debug onto that line and then see if there are any lower level exception info properties you can use.

I recall when those COM errors did pop up they usually meant some Windows COM layer component returned some random number. I don't think anyone ever got any valuable info from them though.

Possibly capturing the message box title is one way of handling the windows event using the Windows Message Event handler....

Possibly something like this:

Using Background Threads with Visual Basic 6

Don

ido_millet
Active Contributor
0 Kudos

Yes, I'm aware that I can go outside the object model for this. I was just checking in case there was something within the object model to handle this.  I'll mark this as answered. Thanks.