Validate the existance of a file on a SharePoint Site (1 Viewer)

Mr. B

"Doctor Access"
Local time
Today, 00:10
Joined
May 20, 2009
Messages
1,932
I am experiencing a really strange problem when attempting to validate the existence of a csv file on our SharePoint server. :banghead:

I am trying to use the same VBA code which I have used for many years to validate the existence of a file. This code works to validate that the file exists when that file is at any other location (ie local hard drive or network drive and/or SharePoint server), when called from the a database file opened in Access 2010 running a Windows XP, but fails when called form the same database file opened in Access 2010 running on a Wiindows 7 machine. Below is the code and some details of what we have tried.

Here is the Public Function code I am using:
Code:
Public Function FileOrDirExists(PathName As String) As Boolean

     'Function Purpose: Function returns TRUE if the specified file
     '                  or folder exists, false if not.
     'PathName        : Supports Windows mapped drives or UNC
     '                : Supports Macintosh paths
     'File usage      : Provide full file path and extension
     'Folder usage    : Provide full folder path
     '                  Accepts with/without trailing "\" (Windows)
     '                  Accepts with/without trailing ":" (Macintosh)
     
    Dim iTemp As Integer
     
     'Ignore errors to allow for error evaluation
    On Error Resume Next
    iTemp = GetAttr(PathName)
     
     'Check if error exists and set response appropriately
    Select Case Err.Number
    Case Is = 0
        FileOrDirExists = True
    Case Else
        FileOrDirExists = False
    End Select
     
     'Resume error checking
    On Error GoTo 0

End Function

Here is how I am calling the function:
Code:
'need to check for the existance of the ppf.???.cxv file
If FileOrDirExists(strSharePointPath) = True Then
    dtCurAvailablePID_Modified = FileLastModified(strSharePointPath)
End If
The "strSharePointPath" in the function call above looks something like:
"//home.companyname.com/sites/rsspm/inflation/Testing/myfilename.csv"

I have changed the exact "Company Name" in the path for security purposes.

When called from a front-end file created in Access 2010, linked to a back-end file located on a network path and opened on a Windows XP machine this function works correctly and finds the existing file. It finds the file if it is located in any path, including the SharePoint site. However, when the same file is opened using Access 2010 on a Windows 7 machine (we have tested on multiple Windows 7 machines), this function finds the existing file if the file is on the hard drive or on a network drive, but tt does not find the existing file when the path to the SharePoint site is provided.

All references have been check in the file when opened on the Windows 7 machine and all are present exactly like those on the Windows XP machine. We have verified that the value being assigned to the "strSharePointPath" variable is exactly the same on both machines. If we take the path that is assigned to the "strSharePointPath" variable and paste it into a browser on the Windows 7 machine we are immediately prompted to open or save the existing file so we know the path is correct. We have even tried pasting the path in Start/Run and again we are prompted to open or save the file.

All other VBA code appears to work correctly in this same file. We have confirmed that the macro setting is set to "Enable all macros". Trusted Locations have been set and tested.

Someone suggested that Access 2010 might be running in "Sandbox" mode on the Windows 7 machine. We have check for the "sandbox" mode setting in the registry, but there is no entry in the registry on that Windows 7 machine to address the "sandbox" mode. See this link:
http://office.microsoft.com/en-us/access-help/use-sandbox-mode-in-access-2010-HA010342092.aspx

Any suggestions and/or help is appreciated.
 

Users who are viewing this thread

Top Bottom