So earlier this week I had to update some old code that used Crystal Reports, and every time I would try to update the code I would either get a "Load Report Failed" or a "Database Logon Failed".
If you have run into those, you'll know all too well that they are simply "catch all" exceptions that bubble up from the crystal reports dlls. Three simple words each, they can literally mean any one of dozens of possible issues... not just what you see.
Database Logon Failed: Could be your login is wrong; could be your datasources are set incorrectly in the report; could be your font in the report is not supported. You don't know, because it won't tell you!
Load Report Failed: Could be that your path to the report is incorrect; could be that your user doesn't have permissions to the windows/temp folder. Could be that the report is corrupted. But will you know? NO! You'll just know "Load Report Failed".
So what do you do if you get one of these?
I recommend the following two things, which will allow you to log the ACTUAL errors to see what in the world just happened. Relevant links to the sources for each suggestion listed below:
1) Go grab sysinternal's "Process Monitor", or "Procmon". Google the company/product if you are unfamiliar; it is generally considered safe and reliable, but make that determination for yourself before proceeding. There are youtube videos on how to use this, but this tool will make your development life 100000x better in the future, if you deal with proprietary dlls often.
2) Here's the biggie. First, lets confirm this will work for you. On the machine having troubles, hop on over the C drive (or whatever drive your stuff is on) and do a search for a dll called "crlogger.dll" If you have it: you're in luck! If not... I'm sorry :( You can try the below, but it may not work.
Hop on over to your System Properties -> Environment Variables. Add the following 3 to system variables:
LOGGING_DIR = c:\logging
LOGGING_ENABLED_ASSERT = 1
LOGGING_ENABLED_RUNTIME = 30
Save, go make that logging folder if it doesn't exist (or set the above to some other directory) and go back to your application. Do whatever you did to break it. Now hop back over to the logging folder and tada! You now have ACTUAL logs. With real, actual errors that you can debug.
In my case, I hit both of those errors.
Load Report Failed: I had installed the 64 bit CR runtime, but NOT the 32 bit which it was looking for. I installed that and this error was defeated.
Database Logon Failed: I looked in the log and found "Microsoft SQL Server Native Client 11.0 Description: Encryption not supported on the client.". Turns out it was 2 things, which procman helped me determine:
1) while I had Client 11, I didn't have a new enough version of it. I went and got an updated installer, specifically the "Microsoft® SQL Server® 2012 Native Client - QFE" installer. (we have 2016, but there is no 2016 native client)
2) I had to add some registry keys! This was made evident via Process Monitor getting failures to find those keys.
Anyhow, that should get you back on the road. Now you wont' have to guess as to WHAT went wrong, and can actually start resolving the issue.
For many of you, this post isn't necessary right now. But I want to make this for visibility, as one day some other poor dev will end up here, after pulling several all-nighters like I did, desperate to find a solution. I spent nearly 30 hours on solving this before I found the logging, and then fixed the problems in under 1 hour after because I actually had actionable items to work on.
Good luck all!