Have a look at
http://www.developer.com/net/cplus/article.php/628191 to get started.
Not using C++, I'm not sure how you add a reference to an object library, but in
VB or Access it is from a module window on the Tools menu. Once the reference is set, you have access to the object model and information about it through the Object Browser.
If you do a goole search you may find an open version of the Access Wizards that are used for report creation. I recall that John Colby of ColbyConsulting.com found an open source version of the Access 97 wizard for creating the switchboard form. You may try emailing him if you are unsuccessful in finding this.
You would start by setting a reference to an existing database object or using the CreateDatabase method of Access. Thereafter you would open the documents collection and reports subcollection and add a report. Thereafter add controls, add a sql string or saved query name record source and then set the bound properties of the controls you added to the controls collection. You can set the top, left, width and height properties as well as the section.
I would suspect that the easiest way to get started is to create a report programatically from within Access. Thereafter, your C++ project could return an Access reference and likely use the exact syntax generated from within Access.
I have used automation for all the Office applications (including Project, Outlook, Word, Excel, PowerPoint and Access) but have not had a reason to generate Reports or Forms on the fly. If you have difficulty generating a report in this fashion, I could probably create a quick example using
VB or Access to create a new report in an external Access container.
When you deploy your application, the target machines must have Access installed for this to work. It would be preferable if they have the same version of Access as it will allow you to use early bound objects.
Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]