Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

Export Access report to a snapshot file and view on web site

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vincel2k2 - 18 Mar 2005 16:45 GMT
Hi,
I need to provide Access reports from our web site. When the app gets to the
output command I get this error I get this error:
The formats that enable you to output data as a Microsoft Excel, rich-text
format, MS-DOS text, or HTML file are missing from the Windows Registry.
Also after the snapshot is created how do I get it to the users web page?
Thanks

Here is my code:
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
       Dim acApp As Access.Application
       Dim strDBPath As String
       Const acQuitSaveNone = "2"
       Const acViewPreview = "2"
       Const acViewNormal = "0"
       Const acOutputReport = "3"
       Const acSendReport = "3"
       Const acFormatRTF = "Rich Text Format (*.rtf)"
       Const acFormatXLS = "Microsoft Excel 97-2002 (*.xls)"
       Const acFormatSNP = "Snapshot Format (*.snp)"
       Const acFormatHTML = "HTML (*.html)"
       Const DB_PATH As String = _
          "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb"

       acApp = New Access.Application
       With acApp
           .OpenCurrentDatabase(DB_PATH)
           ' Print the Product Catalog report.
           .DoCmd.OpenReport("Catalog", Access.AcView.acViewPreview)
           .DoCmd.OutputTo(Access.AcOutputObjectType.acOutputReport,
"Snapshot Format", "C:\Inetpub\wwwroot\YMSReports\DB\Container.snp", False)
       End With

       acApp.Quit()
       acApp = Nothing
   End Sub
Vincel2k2 - 18 Mar 2005 20:37 GMT
I got it, here's the code that works:
   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
       Dim acApp As Access.Application
       Dim strDBPath As String
       Const acFormatSNP = "Snapshot Format (*.snp)"
       Const DB_PATH As String = _
          "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb"

       acApp = New Access.Application
       With acApp
           .OpenCurrentDatabase(DB_PATH)
           ' Print the Product Catalog report.
           .DoCmd.OpenReport("Catalog", Access.AcView.acViewPreview)
           .DoCmd.OutputTo(Access.AcOutputObjectType.acOutputReport, ,
acFormatSNP, DB_PATH & "Container.snp")
       End With

       acApp.Quit()
       acApp = Nothing

       Response.Redirect("C:\Inetpub\wwwroot\YMSReports\DB\Container.snp",
False)

   End Sub

> Hi,
> I need to provide Access reports from our web site. When the app gets to the
[quoted text clipped - 33 lines]
>         acApp = Nothing
>     End Sub

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.