I am having some trouble connecting to an Access database from a program I am working on.

I have a report in the Crystal Report Designer. I have tried connecting to it through different drivers (ODBC, OLEDB, ADO etc) which all work fine in the Designer Preview. However, when I run the report from my application, I get:

"Error: 599: Cannot open SQL server."

I have traced this to a point in the programs code (written some years ago by another developer) which is calling PEStartPrintJob and it is at this point when the error box appears.

The database is not password protected or anything, it is not renamed or moved between design time and run time.

Anybody come across this sort of error before?