Crystal Reports 2008 / 'crdb_fielddef.dll' could not be loaded

Posted: 10/10/2008

In Crystal Reports 10, there was a feature that allowed you to create a report from a data definition file (a ttx file). Basically, this text file laid out the definition of a table (e.g. a line would look like "person_id string 10"). This was handy because you could create the definition of a table without connecting to a database and then from .Net pass a DataTable or IDataReader to the report (this made creating complex reports off of HTML views easy since the code was already done in .Net previously).

The problem that I ran into was, in Crystal Reports 2008 for .Net, the field definition connection type isn't supported. This is the error that is thrown:

Failed to load database information. Details: The database DLL 'crdb_fielddef.dll' could not be loaded. Error in File C:WINDOWSTEMPContacts {9AFA1273-7533-497F-984C-EC0B04039E28}.rpt: Failed to load database information.

My first thought was to find the crdb_fielddef.dll file on my local PC, move it to the server and register it. I had the file, because I have a full version of Crystal 10. Moving it to the server didn't do any good. So, I changed the report from Crystal 10 to Crystal Reports 2008 (which is technically version 10.5 and a newer file format). This allowed me to create an ADO.Net data source to an XML file. I used it in the same way that I had used the field definition, I set up a blank table... Crystal recognized that and allowed me to place those fields on the form. As long as my DataTable in .Net corresponds with that format in the XML, I can set it as the DataSource on the Report Document object (via the SetDataSource sub) then it will render the data in the report perfectly. My XML file looked like this:

<?xml version="1.0" encoding="utf-8" ?>
The reason why I used this approach was because the DataTable object was already created in the code. All the users wanted was a PDF output. I thought, why go to all of the trouble of recreating the complex data queries that are already running in the page for the HTML output when I could just pass that DataTable into Crystal. I Googled for a long while but didn't find a lot of helpful information on those that experienced this error. Hopefully, this will help save someone some time down the line.