Link to home
Start Free TrialLog in
Avatar of Moshe Singer
Moshe SingerFlag for United States of America

asked on

Error when outputting a Report with Snapshot format

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.
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

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
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<<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.
Avatar of Moshe Singer

ASKER

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.
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.
Or get Adobe Acrobat and print to the PDF printer.  That is what I did for Access 97.
thet is wate I am doing now
thanks