![]() |
|
|
Published: Wednesday, April 26, 2000 By Richard Chisholm
(While the main focus of this article will be viewing Access reports, there are a couple of pieces of information that anyone who wants to access Office applications through asp or VB-COM will find useful.) On a company intranet, often times people not authorized to access the web server are responsible for adding content through databases such as Microsoft Access. However, the issue of security is always prevalent. An application like the Online Database Editor in my previous article allows you to add/edit/delete information from any database on a site, but does not allow for the use of a very important part of Access: Reports. Access Reports are highly customizable, allowing you to display exactly the data you want, and often provide a cleaner interface than an HTML page. They are also ideal for producing printable documents intended for distribution. But if you don't allow just anyone to access the intranet's databases, using reports can either be impractical if not impossible. This solution is fairly straightforward and requires surprisingly little coding, as it is mostly a combination of server settings and VBA code adapted for a web environment. And although there is nothing overly complicated in and of itself, piecing together the scattered bits of information can prove very difficult. In fact, a lot of what I will talk about here was discovered in articles & books that are unrelated to ASP. Here is what printing reports involves:
Here are the configurations I tested the application with:
NT Server 4 (SP5) + IIS 4, Access97 On the client side: IE4, Snapshot Viewer 9.0
If you test this on both NTS & NTWS you will notice a few differences. For example, with PWS you may not need
to worry about permissions to launch MS Access. Additionally, the included source code at the end of the
article has two folders, named Before you can do anything however, you need to change the settings. First up, you need to configure IIS to launch applications. Otherwise you will get this error:
This error will occur whenever you try to access an
The second error would occur when you try and create an instance of MS Access, and manifests itself with an
"Access Denied" or similar message. This error may or may not occur depending on your platform. For NT
Server you will get this, but you may not with PWS. The reason? By default the The last hurdle you must clear is setting a default printer, because otherwise you will not be able to generate a report in Access, and get an error like this when you run this asp app:
You will get this error even if there is a default printer assigned to the computer, because IIS runs under the System account, which is not automatically assigned one. So you need to edit the registry in order to assign one. Check out the Knowledge Base article on this subject to find out how http://support.microsoft.com/support/kb/articles/Q184/2/91.asp. Also, make sure you have a default printer assigned to the computer before changing the registry. Now that we've got that part out of the way, on to the good stuff! Part 2 looks at how, exactly, to view the Access reports through an ASP page!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||