Open access report from asp page
Posted on 2004-03-30
I am trying to open an access report from an ASP page. I have the following code on a blank page at the moment.
strDbName = server.MapPath("Databases/library.mdb")
Set objAccess = Server.CreateObject("Access.Application")
objAccess.Visible = True
stDocName = "rptLibraryItems"
objAccess.DoCmd.OpenReport stDocName, acPreview
Set objAccess = Nothing
When I preview the page the database opens but not the report, and the browser gives me a 'this page cannot be displayed' error but no specific error description except for
/intranet/TMP27phbv7zh1.asp, line 13
where line 13 is the docmd.openreport etc line
I have tried opening tables, queries and forms with the same code (modified to docmd.opentable etc) and this all works fine. I have also tried other databases and they have the same problem. Tables, queries and forms will open but not reports.
Is there something really obvious i am missing here?!
Any help appreciated.