ms/access error 76 path not found

I developed an application that, at a certain point intents to upload a file to a server. I am using the "filecopy" command and it works on my machine but on none of the others (its a split data base).

Any clues?
João serras-pereiraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
By "upload" do you mean copy? Filecopy does exactly what it says - it copies a file from one location to another. Filecopy assumes you have permissions to do the copy, and that you're logged into the location where the copy will land.

So if you're not connected to the server, or don't have permissions to the server, then FileCopy will fail.
0
João serras-pereiraAuthor Commented:
well, on  windows explorer I can see the disk on the disk server and navigate (it is a shared folder... but I will double check permissions!
0
João serras-pereiraAuthor Commented:
well... it looks that we need to look into another direction...

I am able, using windows explorer on other computers, to create documents in the destination folder (and copy/past them as well!)

so, the hope for permissions is gone...

My code is quite straightforward and it works perfectly on my computer accessing the same shared disk on the network.

Could it be anti-virus?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jeffrey CoachmanMIS LiasonCommented:
There are still some unknowns here...
1. Starting with your code.   Can you post the full code please?

2. Lets do some basic troubleshooting.
Does this simple code work on your machine as well as the other users:
    FileCopy "C:\YourFolder\YourFile.txt", "C:\YourFolder\YourFileX.txt"
(This basically makes a copy of a file with a different name.)
Then just change the destination to the shared location and see if it fails.
Then change the source file to your specific file.
What we are trying to do here is see if the Source or the Destination, or the file itself is the issue.

In some rare cases it is a timing issue where the source file has just been created and may not be "seen" by the other users as fast as you can see it.

JeffCoachman
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
João serras-pereiraAuthor Commented:
Dear Jeff -

Many thanks for your help. This problem is driving me crazy and, as a matter of fact, when I started my app on other computers to test, on the bottom on the master access window a phrase like "... table not updatable"  showed up for a few moments.

I am posting my code, but I need to hold at least for 3 days as I will be travelling around africa. only tomorrow evening (Lisbon time) or Sunday I will be able to see your comments...

I will also try to follow your suggestion.

THANKS IN ADVANCE

The code is a bit extense, but the filecopy section is shorty:



Private Sub Btn_F31_RegistarDocumento_Click()

    Dim coreDB As DAO.Database

    Dim T00_ControlTableSet As DAO.Recordset, _
        T12_PedidosAssistenciaSet As DAO.Recordset, _
        T13_TarefasPASetNew As DAO.Recordset, _
        T11_FichaDocumentoSet As DAO.Recordset
       
    Dim NoUsersLogged As Boolean, _
        Ibool As Boolean, _
        MissingField As Boolean, _
        MissingMandatoryField As Boolean, _
        FileSelected As Boolean, _
        NoMultiSelect As Boolean, _
        NewWindow As Boolean
       
    Dim NumeroPA As Integer, _
        NumeroTarefaPA As Integer, _
        EmpresaNUIT As Long, _
        EmpreendedorNUIT As Long, _
        NumeroDocumento As Integer, _
        msgResponse As Integer
 
    Dim strUserID As String, _
        strCoreID As String, _
        strGeneric As String, _
        strErro As String, _
        DestinationPath As String, _
        DestinationExtension As String, _
        strDefaultSearchFolder As String, _
        SourceFile As String, _
        strTargetFileName As String, _
        strMsgTxt As String, _
        strMsgTitle As String

    Set coreDB = CurrentDb
    Set T00_ControlTableSet = coreDB.OpenRecordset("T00_ControlTable", dbOpenDynaset)
    Set T12_PedidosAssistenciaSet = coreDB.OpenRecordset("T12_PedidosAssistencia", dbOpenDynaset)
    Set T13_TarefasPANewSet = coreDB.OpenRecordset("T13_TarefasPANew", dbOpenDynaset)
    Set T11_FichaDocumentoSet = coreDB.OpenRecordset("T11_FichaDocumento", dbOpenDynaset)
   
    DocID = Nz(Forms![F91_LoggedUser]![Fld_F91_DocID], 0)
   
    strCoreID = Format(Forms![F91_LoggedUser]![CoreID], "0000")
    strUserName = Forms![F91_LoggedUser]![Fld_F91_NomeCompletoUtilizador]
    strUserID = Format(Forms![F91_LoggedUser]![CurrentUserID], "0000")
    Forms![F91_LoggedUser]![Fld_F91_DocID_Current] = DocID
    Call LogMe("Btn F31 RegistarDocumento \ Click ", "CORE :" & strCoreID & "\ User: " & strUserID & "\" & strUserName)
 
    strUserID = Nz(Forms![F91_LoggedUser]![CurrentUserID], "")
    strCoreID = Nz(Forms![F91_LoggedUser]![CoreID], "")
    EmpresaNUIT = Nz(Forms![F91_LoggedUser]![Fld_F91_EmpresaNUIT], 0)
    EmpreendedorNUIT = Nz(Forms![F91_LoggedUser]![Fld_F91_EmpreendedorNUIT], 0)
    NumeroPA = Nz(Forms![F91_LoggedUser]![F91_CurrentPA], 0)
    NumeroTarefaPA = Nz(Forms![F91_LoggedUser]![F91_IdAtivaTarefaPA], 0)
    NoMultiSelect = False
    NewWindow = True
   
    ' testar os campos para ver se está tudo.
    T00_ControlTableSet.Edit
    MissingField = False
    Fld_F31_TituloDocumento = Trim(Fld_F31_TituloDocumento)
    If Not MissingField And Nz(Fld_F31_TituloDocumento, "") = "" Then
        ' o título não pode ser nulo nem todo a branco
        MostraMensagem ("Titulo do Documento tem de ser preenchido!")
        MissingField = True
    End If
    If Not MissingField And Not FileNameIsOK(Fld_F31_TituloDocumento) Then
        MissingField = True
        MostraMensagem ("Titulo do Documento cm caracteres inválidos!")
    End If
    If Not MissingField And Nz(Fld_F31_DataDocumento, "") = "" Then
        MostraMensagem ("Data de Documento TEM de ser preenchida")
        MissingField = True
    End If
    [T00_ControlTableSet]![T00_NumeroDocumento] = [T00_ControlTableSet]![T00_NumeroDocumento] + 1
    NumeroDocumento = [T00_ControlTableSet]![T00_NumeroDocumento]
    ' o nome do ficheiro deverá ser: "[empresa].[empreendedor].[coreid].[userid].[data].[NumeroDoc].[titulo]
    strTargetFileName = "[" & Format(EmpresaNUIT, "000000000") & "]"
    strTargetFileName = strTargetFileName & "."
    strTargetFileName = strTargetFileName & "[" & Format(EmpreendedorNUIT, "000000000") & "]"
    strTargetFileName = strTargetFileName & "."
    strTargetFileName = strTargetFileName & "[" & strCoreID & "]"
    strTargetFileName = strTargetFileName & "."
    strTargetFileName = strTargetFileName & "[" & strUserID & "]"
    strTargetFileName = strTargetFileName & "."
    strTargetFileName = strTargetFileName & "[" & Fld_F31_DataDocumento & "]"
    strTargetFileName = strTargetFileName & "."
    strTargetFileName = strTargetFileName & "[" & Format(NumeroDocumento, "000000") & "]"
    strTargetFileName = strTargetFileName & "."
    strTargetFileName = strTargetFileName & "[" & Fld_F31_TituloDocumento & "]"

    FileSelected = False
    If Not MissingField Then
        strDefaultSearchFolder = [T00_ControlTableSet]![T00_DefaultOriginPath]
        DestinationPath = ""
        'DestinationFileExtension = "PDF"
        ' a destination file extension vai ser igual à de origem
        'SourceFile = Nz(SelectSourceFile(), "")
        ' selecionar o ficheiro a importar
        SourceFile = Nz(GetFile("Selecionar um Documento", strDefaultSearchFolder, , NoMultiSelect), "")
        'Fld_F31_Document.Object.Navigate SourceFile
        If SourceFile <> "" Then
            FileIsSelected = True
            strMsgTxt = "Deseja abrir o documento?"
            strMsgTitle = "seleção de documento para arquivo"
            msgResponse = MsgBox(strMsgTxt, vbYesNo, strMsgTitle)
            ' Take some action based on the response.
            If msgResponse = vbYes Then
                Application.FollowHyperlink SourceFile, , NewWindow
            End If
            'strMsgTxt = "Deseja Arquivar o documento?"
            'strMsgTitle = "confirmação de arquivo"
            'msgResponse = MsgBox(strMsgTxt, vbYesNo, strMsgTitle)
            'If msgResponse = vbYes Then
            '    FileIsSelected = True
            'Else
            '    FileIsSelected = False
            'End If
        Else
            FileIsSelected = False
        End If
        If Not FileIsSelected Then
            MostraMensagem ("Registo não efetuado por não ter sido selecionado documento de origem")
        End If
    End If
    If FileIsSelected Then  'temos tudo para prosseguir
        SourcePath = Trim(SourceFile)
        ' procurar a extensão do ficheiro origonal
        Dim StrExtension As String
        Dim PointPosition As Integer
        Dim Nchars As Integer
        PointPosition = InStrRev(SourceFile, ".", Len(SourceFile))
        Nchars = Len(SourceFile) - PointPosition
        StrExtension = Right(SourceFile, Nchars)
        strTargetFileName = strTargetFileName & "." & StrExtension
        DestinationPath = RootPath() & strTargetFileName
        DestinationPathXML = RootPath() & strTargetFileName & ".XML"
        ' criar uma Tarefa automática de upload de documento
        strHost = [T00_ControlTableSet]![T00_HostCore]
        [T00_ControlTableSet]![T00_NumeroTarefaPA] = [T00_ControlTableSet]![T00_NumeroTarefaPA] + 1
        NumeroTarefaPA = [T00_ControlTableSet]![T00_NumeroTarefaPA]
        strGeneric = Format([T00_ControlTableSet]![T00_NumeroPA], "0000")
        ' criar uma nova ficha de ação para assinalar que foi feito o contacto
        [T00_ControlTableSet]![T00_NumeroTarefaPA] = [T00_ControlTableSet]![T00_NumeroTarefaPA] + 1
        NumeroTarefaPA = [T00_ControlTableSet]![T00_NumeroTarefaPA]
        T00_ControlTableSet.Update
        With T11_FichaDocumentoSet
            .AddNew
            !T11_DocID = NumeroDocumento
            !T11_Path = DestinationPath
            !T11_SourcePath = SourceFile
            !T11_DestinationPathXML = DestinationPathXML
            !T11_DestinationPath = DestinationPath
            !T11_Titulo = Nz(Fld_F31_TituloDocumento, "sem título")
            !T11_TarefaID = 0
            !T11_PedidoAssistencia = NumeroPA
            !T11_Pasta = Nz(Fld_F31_PastaArquivo, "")
            !T11_LocalPrincipal = Nz(Fld_F31_LocalArquivo, "")
            !T11_DataDocumento = Fld_F31_DataDocumento
            !T11_TipoDocumento = Fld_F31_TipoDocumento
            !T11_Sumario = Nz(Fld_F31_Sumario, "")
            !T11_EmpresaNUIT = EmpresaNUIT
            !T11_EmpreendedorNUIT = EmpreendedorNUIT
            !T11_UploadUserName = strUserID
            .Update
        End With
On Error GoTo errorhandle:
        FileCopy SourceFile, DestinationPath
        '-------------------------------------------------------------------------------------------------------------------
        'generate XML file same name and folder but xml
        strSQL = "SELECT * FROM T11_FichaDocumento WHERE TRUE AND (T11_DocID = " & NumeroDocumento & ")"
        coreDB.QueryDefs("Q08_DocXML").SQL = strSQL
        Application.ExportXML ObjectType:=acExportQuery, DataSource:="Q08_DocXML", DataTarget:=DestinationPathXML
        '--------------------------------------------------------------------------------------------------------------------
        Forms![F28_NovaAcaoTarefa]![Fld_F28_UserMsg] = "Documento " & SourceFile & " arquivado com sucesso em " & DestinationPath
    End If
    Forms![F91_LoggedUser]![F91_FileIsUploaded] = True
    Exit Sub

errorhandle:
   'Problema na Abertura
    strError = Err & ": " & Error(Err)
    Call LogMe("F31 RegistoDocumento \ Btn_F31_RegistarDocumento \ ERROR \ " & strError & " \ ", "CORE :" & strCoreID & "\ User: " & strUserID & "\" & strUserName _
                & " \ File: " & strPath)
    MsgBox "Problema na gravação do Documento"
    Resume Next

End Sub
0
João serras-pereiraAuthor Commented:
Jeff -

I am closing this one as I am not able to reproduce the situation (now I am at about 8,000 Km off the problem..). Nevertheless you are pointing ways of searching for solutions so I need to cover them first.

Thanks in advance.

Just one question: that situation that I found (the message that suddenly disappears "table not updatable", any clues?
0
Jeffrey CoachmanMIS LiasonCommented:
You have a lot of complex code thee and it is difficult to see what may be happening.

You may wish to partner with a local Access developer to help you sort through this all...
0
João serras-pereiraAuthor Commented:
Ok. Thanks anyway. You provided me a path. Now it's on me,...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.