Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dir() and \\machine_name = Error 52 1

Status
Not open for further replies.

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
 
Thanks PHV, I'll give the FSO a try.

Max Hugen
Australia
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top