Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Open access report from asp page

Posted on 2004-03-30
3
Medium Priority
?
361 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
ID: 10716559
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 2000 total points
ID: 10739417
0
 
LVL 1

Author Comment

by:gianitoo
ID: 10741434
thanks that link did it.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Six Sigma Control Plans
Introduction to Processes

877 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