Mar 23, 2010 #1 maxhugen Programmer May 25, 2004 498 AU I'm trying to do ... Code: s = Dir("\\machine_name\myFolder\") ... but I'm getting err 52. Does anyone know if Access supports running Dir() on a path other than a mapped drive? Or am I trying this the wrong way? MTIA Max Hugen Australia
I'm trying to do ... Code: s = Dir("\\machine_name\myFolder\") ... but I'm getting err 52. Does anyone know if Access supports running Dir() on a path other than a mapped drive? Or am I trying this the wrong way? MTIA Max Hugen Australia
Mar 23, 2010 1 #2 PHV MIS Nov 8, 2002 53,708 FR You can't use an UNC with the Dir function but you may play with FileSystemObject: http://msdn.microsoft.com/en-us/library/bkx696eh(VS.85).aspx Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
You can't use an UNC with the Dir function but you may play with FileSystemObject: http://msdn.microsoft.com/en-us/library/bkx696eh(VS.85).aspx Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Mar 23, 2010 Thread starter #3 maxhugen Programmer May 25, 2004 498 AU Thanks PHV, I'll give the FSO a try. Max Hugen Australia Upvote 0 Downvote
Mar 23, 2010 Thread starter #4 maxhugen Programmer May 25, 2004 498 AU PHV, after trying a few options, including kernel32.dll, I finally found that UNCs actually DO work with Dir()! It seems that it will work provided the UNC is Shared. Also, a trailing backslash must be used. eg Dir("\\he-data") - Fails, err 52 Dir("\\he-data\") - Fails, err 52 Dir("\\he-data\hugen data") - Fails, err 52 Dir("\\he-data\hugen data\") - Succeeds ('hugen data' is a shared folder on \\he-data) Max Hugen Australia Upvote 0 Downvote
PHV, after trying a few options, including kernel32.dll, I finally found that UNCs actually DO work with Dir()! It seems that it will work provided the UNC is Shared. Also, a trailing backslash must be used. eg Dir("\\he-data") - Fails, err 52 Dir("\\he-data\") - Fails, err 52 Dir("\\he-data\hugen data") - Fails, err 52 Dir("\\he-data\hugen data\") - Succeeds ('hugen data' is a shared folder on \\he-data) Max Hugen Australia