Solved

Open access report from asp page

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

Author Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

A short article about a problem I had getting the GPS LocationListener working.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

729 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