Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Path/File access error nr 75

Posted on 1999-07-06
6
Medium Priority
?
953 Views
Last Modified: 2012-05-04
HI,

How can I avoid getting error 'Path/File access error nr 75'?

I want to move & rename certain file. For the moment I am using the command 'Name source as target' where source and target represent a different path & file name. Most of the time this is working fine, but sometimes I'm getting above mentioned error.
Now I have seen during debug that 'Name' is substituted with the formname ... ? Is this the reason why I get the error ?
Can anybody give me a hint how to avoid this error ?

I am running VB 5.0 on Windows NT 4.0

Thanks,

Paul
0
Comment
Question by:Polvdv
[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
6 Comments
 
LVL 3

Expert Comment

by:Iexpert
ID: 1522139
Target file may be locked (opened) or marked readonly at certain times ?
can you show us some code ?
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1522140
yeah ,

some code , and "is the only thing you want is to get rid of the error?"

0
 
LVL 2

Expert Comment

by:Torus
ID: 1522141
If the file you want to rename is locked and readonly, I think the error should occur.
However, you can capture the error using Error handling.

public sub RenameFile()
On Error resume next
       Name <Source> as <Target>
       if dir$(Target) <> "" then
            'do what you want
       end if
end sub

By checking if the target exists, you will know that the Name method is success
or not.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Expert Comment

by:filipc
ID: 1522142
Into my application when I recieve error 75, it means the file is already opened by another application. If you recieve the error, wait some seconds and try again.
0
 

Author Comment

by:Polvdv
ID: 1522143
To Filip :

Waiting does not solve the problem.
Sometimes I can solve the problem by simply editing the input file (via FoxPro editor), but this doesn't work always. Sometimes I get message 'Acces denied' and
in those cases I have to reboot my PC before being able to continue processing.

To Iexpert :

Target file is always new file, so it can not be locked or marked read-only

To all :

I also think the source file is locked in some cases for some unknown reason (source file is created by PC3270 print session with data coming from MVS mainframe)

Maybe it is sufficient to unlock the input file before trying to rename it ? Because I am not a VB expert I do not know how to do this.


0
 
LVL 2

Accepted Solution

by:
SLE earned 200 total points
ID: 1522144
We had a similar problem with a simple copy - sometimes it seems that the Windows filesystem is "locking" the file... This is what we did and we never had the problem since:

On Error Resume Next
...
Err.Clear
FileCopy sOrigFile, sTargetFile
If Err.Number <> 0 Then
   i = 0
   Do
      Sleep (250)
      Err.Clear
      FileCopy sOrigFile, sTargetFile
      i = i + 1
   Loop Until Err.Number = 0 Or i > 3
End If
     
If Err.Number <> 0 Then
   MsgBox "A copy error occurred: " & Err.Description
End If
...

I think you should use some sort of retry-mechanism also.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 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