Path/File Access Error '75'
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Path/File Access Error '75'

  1. #1
    Join Date
    Sep 2008
    Posts
    10

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    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.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Sep 2008
    Posts
    10

    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...

  4. #4
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,258

    Re: Path/File Access Error '75'

    Which line of code is generating the error?

  5. #5
    Join Date
    Sep 2008
    Posts
    10

    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?

  6. #6
    Join Date
    Dec 2001
    Posts
    6,332

    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?

  7. #7
    Join Date
    Sep 2008
    Posts
    10

    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.

  8. #8
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Path/File Access Error '75'

    Next time, try:
    Code:
    TSKILL /?  ' on XP
    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!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  9. #9
    Join Date
    Dec 2001
    Posts
    6,332

    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?

  10. #10
    Join Date
    Jan 2006
    Location
    Pearl of the orient
    Posts
    303

    Re: Path/File Access Error '75'

    Quote 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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)