Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open access report from asp page

Posted on 2004-03-30
3
Medium Priority
?
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Progress

722 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