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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 52 - Help Please

Status
Not open for further replies.

RobertT687

Programmer
Apr 2, 2001
425
US
The following bit of code is giving me problems:

Sub DoesItExist()
Dim FTPLocation As String
Dim SearchFor As String
Dim tmpFile As String
Dim FoundName As String

FTPLocation = "\\Server\Folder\SubFolder\"
SearchFor = "*.388"

tmpFile = FTPLocation & SearchFor
FoundName = Dir(tmpFile)
Msgbox "Found Name is " & FoundName, vbOKOnly, "Status"

Exit Sub

When run from designer in VB5 on my PC it works fine.
When compiled and executed on my PC it works fine.

When the same .exe build is executed on another machine, I get error 52 (Bad file name or number).
If FTPLocation is changed to "Drive:\Folder\SubFolder\" (the mapped equivalent of the UNC path)
and executed on the other machine,
I don't get error 52, I get an empty string returned in FoundName.
What am I missing?
The path and file both absolutely exist.
It shouldn't be a permissions problem. The directory is open to Everyone by design.

Any ideas?

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top