-
November 3rd, 2008, 01:56 PM
#1
Path/File Access Error '75'
Hi,
My program has worked fine for the last few months, but today I started getting the above error. Here's my code:
Code:
Private Sub backupFile()
Dim dateToday
Dim RetVal As String
Dim fileDate As Date
dateToday = "_" & Format(Now, "mm-dd-yyyy")
If fileType <> "" Then
newFileName = Mid(fileName, 1, InStr(fileName, ".") - 1) & dateToday & Mid(fileName, InStr(fileName, "."))
ElseIf current_File_Name <> FINISHED_FILE Then
newFileName = Mid(fileName, 1, InStr(fileName, ".") - 1) & "_bad_file_name_" & Mid(fileName, InStr(fileName, "."))
End If
newPathName = BACKUP_PATH & newFileName
RetVal = Dir$(newPathName)
If RetVal <> "" Then
Kill newPathName
End If
Name PATH_NAME & fileName As newPathName
Call getAttributes(newPathName)
Call setAttributes(newPathName)
End Sub
I'm working on this code today, but I'm only working on deleting duplicates from the database tables. I haven't done anything with the files for over a month, so I don't know what happened...
The code is run on the same machine as the files and database, so there's no network programming. I haven't done *anything* to the file system.
Help! Thanks in advance!
teresa
-
November 3rd, 2008, 06:01 PM
#2
Re: Path/File Access Error '75'
You have to have more code than that.
Code:
dateToday = "_" & Format(Now, "mm-dd-yyyy")
If fileType <> "" Then
dateToday is declared as an OBJECT rather than a DATE
What is fileType, and your other variables?
Also, check for viruses and spyware.
Last edited by dglienna; November 3rd, 2008 at 06:04 PM.
-
November 4th, 2008, 10:01 AM
#3
Re: Path/File Access Error '75'
Hi dglienna,
fileType is one of 5 different text files. They are fixed length fields that are loaded into a SQL Server database. fileType will be "master", "milestone", etc.
Will declaring dateToday as a Date change how I will have to format the new filename? All I need is the text of the date to rename the file.
This sub is just renaming the file and moving it from where it sits to a backup directory, and setting the modified date and time to current date and time.
The server this is used on is not accessible to the outside world, so there is no chance of spyware.
I'm running the program now and I'm not having the problem. At least, not yet. We'll see in about 1/2 hour when it has to move another file. It's always been the second file it chokes on. I'll let you know...
-
November 4th, 2008, 10:16 AM
#4
Re: Path/File Access Error '75'
Which line of code is generating the error?
-
November 4th, 2008, 12:11 PM
#5
Re: Path/File Access Error '75'
The line that generated the error was
Code:
Name PATH_NAME & fileName As newPathName
So far today, it hasn't happened, so I'm confused about yesterday. Are there any reasons this could happen if you didn't change a thing on that computer?
-
November 4th, 2008, 01:05 PM
#6
Re: Path/File Access Error '75'
Is there any chance that the app hadn't terminated properly the last time it ran, resulting in two copies running at once?
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
November 4th, 2008, 01:13 PM
#7
Re: Path/File Access Error '75'
You know, that may be possible. I keep the Task Manager open because the program has no interface and I need to see that it is/isn't running, but this morning I had to use Process Explorer to see the processes TM wasn't showing me. I knew the program was still running, but couldn't see it.
I haven't had a problem today, so I don't know.
-
November 4th, 2008, 06:49 PM
#8
Re: Path/File Access Error '75'
Next time, try:
or
Code:
TASKKILL /? ' on Vista
I had a app that fired off batch files, for each letter of the alphabet.
They all had the same name, and took about 15 minutes to run.
When I wanted to kill them all, task manager took too long.
Code:
TSKILL /IM appname*
This workied to sell, that I added it to a button for the client!
-
November 5th, 2008, 08:16 AM
#9
Re: Path/File Access Error '75'
It's a simple matter of checking App.PrevInstance in your startup code, and exit if there's already a copy running. You can also display a message box to notify the user.
Do you have it showing a system tray icon?
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
November 5th, 2008, 09:02 AM
#10
Re: Path/File Access Error '75'
 Originally Posted by WizBang
It's a simple matter of checking App.PrevInstance in your startup code, and exit if there's already a copy running. You can also display a message box to notify the user.
Do you have it showing a system tray icon?
Or Mutex...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
On-Demand Webinars (sponsored)
|