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

"access is denied" error with MODI Viewer Control in Access 2007

P: 69
Hi everyone. I have a form in my Access 2007 database with a Microsoft Office Document Imaging Viewer Control 12.0 object on it. The object is named "GRAPHIC_mdv". When the form opens I want to take the path and filename information passed to the form (via the form's opening arguements) and display the file in the MODI Viewer Control object. I'm using the following code to do this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. Dim miDOC As MODI.Document
  3. Dim miDOC_VIEW As MODI.MiDocView
  4.  
  5.         'Set a reference to the MDV object on the form
  6.         Set miDOC_VIEW = GRAPHIC_mdv.Object
  7.  
  8.         'Set a reference to a new MODI document object
  9.         Set miDOC = New MODI.Document
  10.  
  11.         'Open the file in the MODI document object
  12.         miDOC.Create Me.OpenArgs
  13.  
  14.         'Associate the MODI document to the MODI viewer control
  15.         miDOC_VIEW.Document = DOC
  16.  
  17. End Sub
All of the sample code I've seen uses this simple approach to displaying a image file in a MODI Viewer Control. My problem is the line:

Expand|Select|Wrap|Line Numbers
  1.         miDOC.Create Me.OpenArgs
When the program execution gets to this line I get an "access is denied" error. Anyone know what this is about?

I've tested the path and filename being passed to the form and they are correct (i.e. it points to a valid TIF file that I can open with the MODI program that comes with Office 2007).

Any thoughts are greately appreciated.

Regards,
sphinney
Oct 8 '08 #1
Share this Question
Share on Google+
2 Replies


missinglinq
Expert 2.5K+
P: 3,532
Never used this control, or even knew that it existed, but my first thoughts would be that the error message "access is denied" means exactly what it says! Access error messages are not known for accurately reflecting the problem, but sometimes they actually do! Does the user have access/network rights to the folder holding the image file?

Linq ;0)>
Oct 8 '08 #2

P: 69
Never used this control, or even knew that it existed, but my first thoughts would be that the error message "access is denied" means exactly what it says! Access error messages are not known for accurately reflecting the problem, but sometimes they actually do! Does the user have access/network rights to the folder holding the image file?

Linq ;0)>
Interesting. The user has read but not write permissions for the files I was testing with. When I re-tested the code using a file I knew the user had write permission to, the code worked. So using the "Create" method must want to open the file with write permissions, and when the user doesn't have write permissions, it throughs a "access is denied" error.

So, as you suspected, "access is denied" really means access is denied. Brilliant!

Thanks for helping me see the obvious. I'm feeling pretty silly.

By the way, the Microsoft Office Document Imaging is tool (and ActiveX component) that comes with every copy of Office (although you can choose not to install it if you wish). It has more zoom, pan, save-as and copy functionality that the Picture control that comes with Access. There is some information about this component on MSDN, but it's very limited.

Thanks,
sphinney
Oct 9 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.