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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sphinney
    New Member
    • Mar 2007
    • 69

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

    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_md v". 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:

    Code:
    Private Sub Form_Open(Cancel As Integer)
    Dim miDOC As MODI.Document
    Dim miDOC_VIEW As MODI.MiDocView
    
            'Set a reference to the MDV object on the form
            Set miDOC_VIEW = GRAPHIC_mdv.Object
            
            'Set a reference to a new MODI document object
            Set miDOC = New MODI.Document
            
            'Open the file in the MODI document object
            miDOC.Create Me.OpenArgs
            
            'Associate the MODI document to the MODI viewer control
            miDOC_VIEW.Document = DOC
    
    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:

    Code:
            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
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    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)>

    Comment

    • sphinney
      New Member
      • Mar 2007
      • 69

      #3
      Originally posted by missinglinq
      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

      Comment

      Working...