How do I check if a file exists, _besides_ using Dir$(), as using Dir sometimes gives an error (especially when the path give is too long, i think).
Printable View
How do I check if a file exists, _besides_ using Dir$(), as using Dir sometimes gives an error (especially when the path give is too long, i think).
File System ??
I seem to remember seeing a reply to this same question within the past month. I believe the solution used API calls. Try searching the older posts.
I think I have found just what you are after - Take a look : -
http://www.planetsourcecode.com/xq/A...s/ShowCode.htm
Hope this helps :):)
Make reference to Microsoft Scripting Runtime
option Explicit
private Sub Form_Load()
Dim fso as FileSystemObject
set fso = new FileSystemObject
If fso.FileExists("C:\Programing\David\database.ini") then' Put your file name in here
MsgBox "Found"
else
MsgBox "Not Found"
End If
End Sub