PC Review


Reply
Thread Tools Rate Thread

Check that path exists.

 
 
=?Utf-8?B?QnJ1Y2U=?=
Guest
Posts: n/a
 
      1st Jun 2005
in my code below a is a path to a remote server. How can I test if the path
exists;

i.e if a something then....

Bruce

Private Sub copyDB()

Set fs = CreateObject("Scripting.FileSystemObject")

myDest = Array("\\myServer\myShare\myFolder\")

For Each a In myDest
If a not exist then
Msgbox(“Path not Found”)
End
End if
Next a
End Sub


 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      1st Jun 2005
If you are working in Access:

Public Function FolderExists(varPath As Variant) As Boolean
On Error Resume Next
If Len(varPath) > 0& Then
FolderExists = (Len(Dir$(varPath, vbDirectory)) > 0&)
End If
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Bruce" <(E-Mail Removed)> wrote in message
news:E63426DB-1C6A-4D39-A051-(E-Mail Removed)...
> in my code below a is a path to a remote server. How can I test if the
> path
> exists;
>
> i.e if a something then....
>
> Bruce
>
> Private Sub copyDB()
>
> Set fs = CreateObject("Scripting.FileSystemObject")
>
> myDest = Array("\\myServer\myShare\myFolder\")
>
> For Each a In myDest
> If a not exist then
> Msgbox("Path not Found")
> End
> End if
> Next a
> End Sub



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if folder path exists PsyberFox Microsoft Access 4 18th May 2010 02:09 PM
verify a path exists =?Utf-8?B?SkxHV2hpeg==?= Microsoft Excel Programming 13 24th Aug 2006 11:13 PM
How can I determine that the path exists? Stan Microsoft Dot NET 2 5th May 2005 06:59 PM
Check wether path exists =?Utf-8?B?am9rb2Jl?= Microsoft Access VBA Modules 1 31st Mar 2005 01:55 PM
Path Exists / Create Path David Schwartz Microsoft VB .NET 3 29th Sep 2003 09:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:40 AM.