Hello All,
I am using the Dir function in VB6 and seem to have encountered an
upper limit on the length of the PathName passed into the Dir
function.
When I have a Path longer than 260 (inclusive) characters then using
Dir generates the following error.
[Microsoft Visual Basic]
------------------------------------
Run-time error '53':
File not found
------------------------------------
Notes:
1. Yes I have verified that the file already exists at the path.
2. If I decrease the filepath length to 259 chracters then this works
fine. If I change it to 260 char. this error is generated.
Questions:
1.Could someone confirm this upper limit as I couldn't find any
indication of this on Microsofts site?
2. Any advise on an alternative to using Dir?
Thank you very much for any insight into the problem.
Neil Goundar.
Some test code:
In VB i have the following as a test (in the immediate window):
?len(dir("C:\Neil's Work Email In HTML\March 2007 Email\March Inbox
Items\test rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrruhsadfhdasldhasfjhgjasdgh
Test Test Test Test TestTest Test Test Test TestTest Test Test Test
TestTest Test Test Test TestTest Test Test Test Tes\yutruyfgdsuyf uy
fufauefguywfuysdfuyfdsuayf uysafd uyfdsa uyfuysfd uyfdsa uyf dsuy fduy
fdsuyasdfuysdf uyfsaduyfduay.txt"))
Archived from group: microsoft>public>vb>general>discussion