?
Solved

Debug: Path/File access error (Error 75)

Posted on 2008-10-08
8
Medium Priority
?
589 Views
Last Modified: 2008-11-06
Hello ~

I am receiving a "Path/File access error (Error 75)" on the line:

            Kill Me.ImageAddress

in the piece of code below.  By debug.print 'Me.ImageAddress': K:\Access Database\Pictures_Assigned2006\30-34028-S2-301.jpg

it IS correct and the file IS there.

I'd appreciate your ideas on how to correct this.

Thank you, Jacob



If Me.ImageAddress <> "K:\Access Database\Images\NoImage.bmp" Then
 
            ' Removes image from file
            Debug.Print Me.ImageAddress
            Kill Me.ImageAddress
            Me.ImageAddress = Null
            Me.Requery
            MsgBox "Image deleted."
 
        End If

Open in new window

0
Comment
Question by:Chi Is Current
[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
  • 3
8 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 22676179
Probably there is a file lock on this file, which means that another process, program is still using this file.
0
 
LVL 2

Author Comment

by:Chi Is Current
ID: 22676193
Dhaest ~ Thank you for your reply.

Hmmmmmm an interesting idea.  I'm not seeing how this could be possible though.  The entire procedure is below.

Is there a way I can check?

Jacob
Private Sub cmdDeleteImage_Click()
'On Error GoTo Err_cmdDeleteImage_Click
'Deletes SPEC Image
    Dim strPath As String
 
    strPath = "K:\Access Database\Images\NoImage.bmp"
 
 
    If MsgBox("You are about to delete this image. Are you sure?", vbYesNo) = vbNo Then
        Exit Sub
    End If
 
 
    If IsNull(Me.ImageAddress) = False Then
        If Me.ImageAddress <> "K:\Access Database\Images\NoImage.bmp" Then
 
            ' Removes image from file
            Debug.Print Me.ImageAddress
            Kill Me.ImageAddress
            Me.ImageAddress = Null
            Me.Requery
            MsgBox "Image deleted."
 
        End If
    End If
    
Exit_cmdDeleteImage_Click:
    Exit Sub
 
Err_cmdDeleteImage_Click:
    MsgBox Err.Description
    Resume Exit_cmdDeleteImage_Click
 
 
End Sub

Open in new window

0
 
LVL 53

Expert Comment

by:Dhaest
ID: 22676222
Perhaps you should try to switch these 2 lines
            Kill Me.ImageAddress
            Me.ImageAddress = Null

Because Me is still holding a referenct to your image, which can block your kill
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 2

Author Comment

by:Chi Is Current
ID: 22676254
It seems switching:

Kill Me.ImageAddress
Me.ImageAddress = Null

to

Me.ImageAddress = Null
Kill Me.ImageAddress

would remove the filename of the file I want to delete.
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 22676313
Add a string then, before deleting it
dim myImage as string
myImage = me.imageAddress
Me.ImageAddress = Null
Kill myImage
0
 
LVL 2

Author Comment

by:Chi Is Current
ID: 22680824
Dhaest ~

Good idea, thank you.  I wrote the address to a variable and attempted to delete the variable.

Then path name IS correct; however, I still receive: Path/File access error (Error 75)
0
 
LVL 7

Expert Comment

by:UniqueData
ID: 22896663
I know an answer was already accepted, but I thought I would add something I came across.  I was getting the same error and I noticed that the file attributes had ReacOnly turned on.  I was given the suggestion to change the attributes before the Kill statement and it worked perfectly.  My post can be found here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23879799.html#a22896634
0
 
LVL 2

Author Comment

by:Chi Is Current
ID: 22898527
UniqueData ~  Thank you for your comment here.  THAT WAS EXACTLY WHAT I DISCOVERED TOO!  Dheast's suggestion in the first comment kind of pointed me in that direction, when it was obvious there was no way the file could be in use.  At the time, I didn't post it because of my deadline.

Somehow, whoever was generating new files had begun setting the ReadOnly property ON, unbeknownst to anyone else!  So I did include a statement in my function to change the property before the kill statement and it was fine.

Thank you for your contribution here.  I trust this will serve others!

Best Regards, Jacob
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

801 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