Solved

Error when outputting a Report with Snapshot format

Posted on 2016-08-01
7
37 Views
Last Modified: 2016-08-03
In Access 97, Windows 10, I am trying to output a Report using Snapshot Format.
I installed the Service Release 1 Patch for Access 97
to be able to  output a Report using Snapshot Format
I use the following command
DoCmd.OutputTo acOutputReport, Report, "SnapshotFormat(*.snp)", "", True
(Please note that after the fourth comma of the code, I added quotes, so that the system will prompt me for a location where to save the report.)

When it tried to save the report, it opens a dialog box where I can select the destination, it shows me the saved filename, but in reality it did not save the file, it shows me an error message:
Runtime error 2587. MS Access cannot complete the output operation.
I took this information from the following address;
http://www.lebans.com/reporttopdf.htm
I downloaded from there the sample database, and noticed that the only difference that maybe causing the problem is that the References that are checked off in the sample database are 1) Microsoft ActiveX Data Objects 2.5 Library. and 2) Microsoft DAO 3.6 Object Library.
In my own database, I can only use the Microsoft DAO 3.51 Object Library, because if I use the 2 above References, I get error messages for all my RecordSets.
0
Comment
Question by:Moshe Singer
7 Comments
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 41738163
You need to firstly check that Windows 10 supports the snapshot format. Office 2010 and later do not, and so there may not be a valid reader for it.

Assuming that there is, have you tried using the constant acFormatSNP (without quotes) instead of  "SnapshotFormat(*.snp)"?

Kelvin
0
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
ID: 41738186
A97, while my favorite Access version EVER, is woefully out of date.  It is 19 years old.  In human years, that's got to be close to 200 years!!

Current versions of Access have a FREE runtime edition.  You can purchase one version of A2016 for the developer and use the free download for everyone else to run the application.  Keep in mind that you can't convert from A97 directly to A2016.  You would have to have some older version of Access such as A2003 or A2007 to do the conversion.   Then you could take the app the rest of the way to A2016.  The downside to using the runtime is that the application must control the interface completely using forms and reports since the runtime will not allow the user to open any object in design view.  You also need to use robust error trapping to avoid having the app just up and shut down if it encounters an untrapped error.  Start a new thread if you want to proceed with this.
0
 
LVL 57
ID: 41738833
<<Runtime error 2587. MS Access cannot complete the output operation.>>

 This probably has more to do with drivers and the OS than anything.

<<I downloaded from there the sample database, and noticed that the only difference that maybe causing the problem is that the References that are checked off in the sample database are 1) Microsoft ActiveX Data Objects 2.5 Library. and 2) Microsoft DAO 3.6 Object Library.
In my own database, I can only use the Microsoft DAO 3.51 Object Library, because if I use the 2 above References, I get error messages for all my RecordSets.>>

 The reason is the order of the references is important if you have not explicitly declared things.

 ADO and DAO both have a recordset object and while similar, they are not the same.  So if your code is currently using DAO and you've done this:

 Dim rs as Recordset

 and the ADO reference is listed first, your code will error because it thinks it is an ADO recordset.   You can either move the DAO reference before the ADO one or explicitly declare everything:

 Dim rs as DAO.Recordset
 Dim rs2 as ADODB.Recordset

Then the code will compile without error.   Fix that first and then see if the snapshot format works.

 and BTW, if this is to get PDF output, there are other ways to achieve that.

Jim.
1
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Moshe Singer
ID: 41739276
Hi Jim

<<and BTW, if this is to get PDF output, there are other ways to achieve that>>
Thanks a million for your comments. I will try it out now. But you mentioned that there are other ways to achieve outputting a pdf. If you can recommend those other options I will be very appreciative.
Looking forward to your reply.
0
 
LVL 57
ID: 41739366
One other popular method in years past was to define a printer with post script output and then use Ghost Script to translate it to a PDF.

The other is to use a printer driver (i.e. CutePDF) that goes straight to PDF.

Jim.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 41740794
Or get Adobe Acrobat and print to the PDF printer.  That is what I did for Access 97.
0
 

Author Closing Comment

by:Moshe Singer
ID: 41740902
thet is wate I am doing now
thanks
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now