p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: FW: RE: Script to run Access report and return results to page


Message #1 by "Daniel Walker" <danielw@w...> on Mon, 20 Mar 2000 15:29:49
Thanks very much, Dave. We appreciate the time you took over this one.
DanW
----------------------------------
George

This was forwarded to me last week, but I've been away so have only just
seen it.

I've just spent an hour delving into Access, and I'm not sure it's easy
to replicate. There seems to be no way to invoke the Publish To Word
menu item from within code. Older versions of Access had the
DoCmd.DoMenuItem, and it's supposed to still work, but I can't get it to
work properly. It's no longer supported as a macro item, but is
supported from code, but I've had no luck yet.

I have got this working:

    DoCmd.OutputTo acOutputReport, "report_name", acFormatHTML,
"file_name"

but the format it comes out in isn't great. It saves each page as a
separate html file and gives links to the next page, and the text wasn't
aligned properly in my report.

Other than that I can't think of a simple way to do this in the way you
are aiming at. Personally I'd create an ASP page that gets the data from
Access and constructs HTML tables. That might be a better long term
approach, and it gives you more control over the output.

Dave

> > -----Original Message-----
> > From: George Mizzell [mailto:gmizzell@b...]
> > Sent: Friday, March 10, 2000 13:16
> > To: Daniel Walker
> > Subject: RE: Your post P2P
> > 
> > 
> > Daniel,
> > 
> > As I said, I don't know of much else I can say about it.  But 
> > here goes.
> > 
> > In Access 2000, MS provided Data Access Pages as a way of 
> > simulating ASP on
> > the internet.  This works well if you don't need much 
> > interactivity but
> > simply way to enter data and get heirarchal reports.  
> > However, I can edit
> > the HTML/Script on the data access pages to make it more 
> interactive.
> > 
> > Next:  In Access as you create reports from Access, you give 
> > them a name.
> > If you are in Access, you simply double click on the report 
> > name and it runs
> > the report.  Access then gives you the option to publish the 
> > reports to
> > Word, which I do.  Then Access takes me to Word and I save 
> > the file as a web
> > page that can be viewed in IE5.
> > 
> > All I need to do is add a button on the data access page that 
> > will run that
> > "already named" report and then using the VBscript, with Word set to
> > "application.visible = false", execute the save as HTML 
> > command and then
> > return that report to the browser.  I can do it all manually 
> > in about 15
> > seconds, but I want the ASP to do it when someone clicks a 
> > button.  I know
> > the VBA, but the script object model for Access is an alien 
> > life form and MS
> > did not give Access a Record Macro feature that would let me 
> > get a hint at
> > what the right object is and what the method syntax is.
> > 
> > Functionally it seems simple, but for the life of me I can't 
> > find a hint of
> > how to do it.  It is easy to put a button in java or 
> > vbscript, but telling
> > it what to do at the server is the problem.  By the way, all 
> > users have
> > Office 2000 with web components and all users will have IE5 - 
> > so no need to
> > worry about the various ways of doing this to satisfy all 
> > known browsers
> > since windows 3.11.
> > 
> > Thanks for your help
> > George Mizzell 
> 
---------------------------------

I think this is, what seems to be a simple thing, but can't find anyway to
do it.

I have data access pages built on Access 2000 and they work fine for 
entering the data. I have Access 2000 reports built to analyze the data. 
What I need is a button on the data access apge that has the script that 
will execute the access report and return the results as an HTML web page.
Naturally I can have the web hyperlink to a html page by runnig the report
manually, saving as word file, opening word and resaving as HTML; but this
seems rather dumb to do. Since MS didn't have the foresight to include a 
macro recorder in Access like the other office products, I have not been 
able to find out even what the objects are that need to be used to do this
and certainly not a clue on what the code would be. For the last several 
days I have had this request posted on the MS Access programming 
newsgroups, but apparently this subject is way outside of their expertise
because no one has even responded. So upon receiving my Professional 
Active Server Pages 3.0 book, I looked for what the subject would be and 
did not find it yet (I didn't find it in 2.0 either). I really need a good
jump start here.

Can anyone help???

  Return to Index