1、VB中怎么载如或显示Access数据库中的报表'首先在“工程/引用”菜单下引用Microsoft Access 9.0 Object LibraryOption ExplicitDim MSAccess As Access.ApplicationPrivate Sub Command1_Click() Set MSAccess = New Access.Application MSAccess.OpenCurrentDatabase (App.Path & "db1.mdb")
2、MSAccess.DoCmd.OpenReport "rptTB", acViewNormal MSAccess.CloseCurrentDatabase Set MSAccess = NothingEnd SubrptTB是access中的一个报表名称要引用Microsoft Access 9.0 Object Librarydim objAccess As Access.Application Set objAccess = CreateObject("Access
6、DatabaseApp.Path&"data.mdb"EndIfacc.docmd.OpenReport"打印准考证"',acPreview打印报表“打印准考证”acc.QuitSetacc=Nothing使用ACCESS报表主要缺点就是不能预览怪问题:在Access里新建了报表后,VB/VC可不可以直接调用并打印?'先引用access obj Option Explicit Private Sub Form_Load() Call PrintReport(App.Path
7、& "test.mdb", "test") End Sub Private Function PrintReport(ByVal MdbFileName As String, ByVal ReportName As String) As Boolean On Error GoTo ErrTrap Dim localReport As New Access.Application Call localReport.OpenCurrentDatabase(