By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,030 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,030 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.acOutput Report,
"Snapshot Format", "C:\Inetpub\wwwroot\YMSReports\DB\Container.sn p", False)
End With
acApp.Quit()
acApp = Nothing
End Sub
Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.acOutput Report, ,
acFormatSNP, DB_PATH & "Container.snp")
End With
acApp.Quit()
acApp = Nothing

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

End Sub

"Vincel2k2" wrote:
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.acOutput Report,
"Snapshot Format", "C:\Inetpub\wwwroot\YMSReports\DB\Container.sn p", False)
End With
acApp.Quit()
acApp = Nothing
End Sub

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.