1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| ' instantiate Access
Dim objAccess As Microsoft.Office.Interop.Access.Application
objAccess = New Microsoft.Office.Interop.Access.ApplicationClass
' make Access visible to the user
objAccess.Visible = True
' open the Northwind sample database
objAccess.OpenCurrentDatabase(filepath:="C:\Inetpub\WebSite1\OSA_ADS.mdb")
' identify the report you want to display
objAccess.DoCmd.SelectObject(ObjectName:="Edit", InDatabaseWindow:=True, _
ObjectType:=Microsoft.Office.Interop.Access.AcObjectType.acReport)
' show the report
objAccess.DoCmd.OpenReport(ReportName:="Edit", _
View:=Microsoft.Office.Interop.Access.AcView.acViewPreview)
objAccess = Nothing |