[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 64
  • Last Modified:

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.
0
Moshe Singer
Asked:
Moshe Singer
1 Solution
 
Kelvin SparksCommented:
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
 
PatHartmanCommented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
Moshe SingerAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
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
 
Helen FeddemaCommented:
Or get Adobe Acrobat and print to the PDF printer.  That is what I did for Access 97.
0
 
Moshe SingerAuthor Commented:
thet is wate I am doing now
thanks
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now