Solved

Open access report from asp page

Posted on 2004-03-30
3
353 Views
Last Modified: 2009-07-29
I am trying to open an access report from an ASP page. I have the following code on a blank page at the moment.

<%
dim strDbName
dim objAccess
strDbName = server.MapPath("Databases/library.mdb")
Set objAccess = Server.CreateObject("Access.Application")
objAccess.Visible = True
objAccess.OpenCurrentDatabase strDbName
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

Error Type:
(0x800A08A4)
/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.
0
Comment
Question by:gianitoo
3 Comments
 
LVL 8

Expert Comment

by:plq
Comment Utility
Maybe I'm wrong but...

Sounds like a strange architecture to me, how can you open a report from server code ? The end user won't see it, it'll just be a document opened on the server.

I've used access reports from VB.NET - use docmd.outputto to save the report as a .SNP file. Then you can divert the users browser to this file through an object tag to microsofts ocx for snapshot viewer. I won't get into that too deep - please explain what you're trying to achieve

thanks
0
 
LVL 2

Accepted Solution

by:
rqs earned 500 total points
Comment Utility
0
 
LVL 1

Author Comment

by:gianitoo
Comment Utility
thanks that link did it.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now