cancel
Showing results for 
Search instead for 
Did you mean: 

Database connection error using ADO.NET DataSets

Former Member
0 Kudos

Hi,

I created a Windows application to print reports with Crystal Reports. Instead of accessing my MS Access Database directly, I used a ADO.NET DataSet Schema as my datasource for the reports. I followed the Crystal Reports Tutorial to creat a DataSet Schema, populate the Dataset with data from my MS Access database, create reports that connect to the DataSet schema.

http://msdn.microsoft.com/en-us/library/ms227647(VS.80).aspx

To cross check if the reports work correctly, I usually make a similar report directly accessing the Access Database. My problem is, e.g. I create a report with 5 tables from the Access Database. Then I create the same report using the DataSet and link/join the tables in the same manner as in the Access Database. But sometimes, I got the error "Unknown Database Connector Error" or "Failed to retreive data from the database". It seems to me that ADO.NET doesn't support some of the JOINS and table linking as in the "real" database.

Has anyone got the same problem? Is it a limitation of ADO.NET DataSet or a limitation of CR using ADO.NET?

Working environment:

- CR 2008

- VB.NET 2005

Your help is much appreciated. Thank you very much.

Best regards,

Agnes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

When you get a database logon prompt like this it normally means the dataset you're creating at runtime does not match the schema that the report was designed with.

The simplest thing to do is write out the dataset to XML with Schema after you fill the dataset. Once you've written out the dataset you can go back to the report in Crystal Reports itself and try to point the report to the XML file directly. If you get any errors this confirms that the dataset does not match what the report is expecting.

Try it, address any differences, and you should be all set.

Sincerely,

Amit

Former Member
0 Kudos

Thanks Amit.

To create the DataSet, I just open my sample Access Database, drag and drop all the tables in it, and create the neccesary links between the tables.

I can't see anywhere to define the link properties, e.g. INNER JOIN or OUTER JOIN when I create the DataSet. Will this cause the inconsistency problem that you mentioned?

Also, some tables in my sample database are actually wandering around, that is, they're not linked to any of the tables in the Database. Does DataSet support this kind of behaviour?

Best regards,

Agnes

Answers (0)