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

GetAttr function - string length limit

Status
Not open for further replies.

Maturi

IS-IT--Management
Oct 9, 2003
81
GB
Hi

I’m using the GetAttr() function to determine whether the contents of a folder is either a file or another folder using

If (GetAttr(stPath & stName) And vbDirectory) = vbDirectory Then

The problem is that I’m getting a runtime error when I query some files. I think this is because the files are held on a LAN and the full path and filename string is greater than 256 characters. And presumably GetAttr cannot accept strings greater than 256 as input.

Can someone confirm that?

I cannot shorten the pathname (because so many users already use the path) and I can’t force a mapped drive (say X: = \\servername\group\etc. and then use the mapped drive letter instead of the full pathname) because the user population is widespread and I cannot determine every user.

Does anyone know of a different way to tell if an item is a folder or file without this string length problem?

Or is there another way to do this altogether

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top