Can anyone tell me how easy (or difficult) it is to integrate an Access97 report into a VB6 app. If it is easy, a simple explanation of how to do it would be greatly appreciated.
Thanx in advance
Steve
Printable View
Can anyone tell me how easy (or difficult) it is to integrate an Access97 report into a VB6 app. If it is easy, a simple explanation of how to do it would be greatly appreciated.
Thanx in advance
Steve
It's not too bad with a little automation:
User must have Access installed on system -- Add a reference to the Access Object Library.
Dim axs As New Access.Application
axs.OpenCurrentDatabase ("c:\data\path\here.mdb")
axs.DoCmd.OpenReport "ReportNameHere", acViewNormal
axs.CloseCurrentDatabase
Set axs = Nothing
This will print the report -- but as far as complete integration with your app (without MS Access) I do not believe that you can access the report like you can with a table or query.
HTH
Tom
check out the second and third parameters of the DoCmd function, you can specify a filter and/or a where condition. Otherwise, you can access the report via the axs.reports collection and manipulate report properties there (like set the SQL statement of the recordsource before you print it). I didn't try it myself, let me know if you have problems.
Tom
Thanks Tom, that works great. Any idea about how to give my a report a parameter from VB. Any info will be greatly appreciated.