>In my applicaiton I like to do a simple report. For the first time I am looking at the DataReport of VB6.0 and I have problem making it work.
>
>My data is in a .MDB. I set the DataSource to c:\myapp\mydata.mdb. When I right click on the report and do restore structure I get a error.
>
>In the documendation we found only information on ADO so can I use direcly my MDB in the DataReport?
To use the Data Report, you need an ADO data source and Access is a valid provider to work with ADO.
There is a couple of ways to open an ADO connection:
1- You can use the Data Environment to create a Connection to your database and then you create commands that will retrieve fields for your report. This way you will be able to drag & drop fields from the Data Environment to your data report. Easy no?
2- You can also programmatically open a connection and set a recordset to the report DataSource property like this:
Set DataReport1.DataSource = rsYourValidRecordset
There is still some bugs with the DataReport (like you will hardly be able to print landscape).
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com