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
Solved

Open access report from asp page

Posted on 2004-03-30
3
356 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 500 total points
ID: 10739417
0
 
LVL 1

Author Comment

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.

856 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