Solved

Access 2007 error 2950, even in trusted area

Posted on 2012-04-09
5
1,113 Views
Last Modified: 2012-04-17
I call an Access 2007 macro with a shell command from VB6.
The macro runs fine until end when it calls a vba code module, and produces error 2950 ( 2950 is supposed to be because DB is in untrusted path).

I went into Access, and added this server folder as trusted location.

The code module that results in error 2950 is:

Function WorkPeriodHoursReport()
Dim i As Integer
On Error Resume Next
Kill "C:\RWH2\" & "MyReport" & ".pdf"
  DoCmd.OutputTo acOutputReport, "WorkPeriodHoursReport", acFormatPDF, "C:\RWH2\" & "MyReport" & ".pdf", False

'Method 1
Application.FollowHyperlink ("C:\RWH2\MyReport.pdf")

'or Method 2
Dim MyShell As Variant
'MyShell = Shell("C:\RWH2\printPDF.bat", vbMinimizedNoFocus)
End Function

Funny thing is that it worked in past!

Need fix fast for client - 500 points!
Any fix appreciated!

-Larry
0
Comment
Question by:Larry Biederman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 100 total points
ID: 37825490
try this setting
Office Button > access options > trust center > trust center settings > macro settings > enable all macros
0
 

Author Comment

by:Larry Biederman
ID: 37825712
I did set enable all macros.  Also added Q:\ drive as trusted area.
Doesn't work.

Thanks for input!!
0
 

Accepted Solution

by:
Larry Biederman earned 0 total points
ID: 37838963
If I "OutputTO" a blank report first, it works!
Strange.
0
 

Author Comment

by:Larry Biederman
ID: 37851813
I gave the expert 100 points for a single reply.
Although didn't fix, I ap[preciated efforts.

If moderator wants to give him all 500 points, ok.
Whatever is fair.

lbiederman
0
 

Author Closing Comment

by:Larry Biederman
ID: 37854960
Other solution didn't work.  Somehow OutputTO a report that's blank first worked.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

751 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