FolderExists behavior 
Author Message
 FolderExists behavior

I am trying to check existence of a folder in a specified
directory and create one if one does not exist.  Yet, it
FolderExists checks for True even if nothing is there:

   If Not fsInd.FolderExists("sFolderPath") Then
      Debug.Print "it does not "
      fsInd.CreateFolder ("sFolderPath")
    Else
      Debug.Print "It does"
    End If

Any ideas why?  Thanks



Sat, 18 Sep 2004 14:58:52 GMT  
 FolderExists behavior
Hi,

Did you declare fsInd somewhere? If so, did you use early binding, late
binding, or what? Your code snippet doesn't answer those questions. You
probably want to remove those double quotes from around your sFolderPath
variable too. Lastly, I think your CreateFolder line will need a return
variable based on examples I've seen.

--
Calvin Smith
http://www.CalvinSmithSoftware.com
"Real-world Source Code Solutions"
*** http://www.CalvinSmithSoftware.com/CalvinSmithDoesWebsites.htm ***


Quote:
> I am trying to check existence of a folder in a specified
> directory and create one if one does not exist.  Yet, it
> FolderExists checks for True even if nothing is there:

>    If Not fsInd.FolderExists("sFolderPath") Then
>       Debug.Print "it does not "
>       fsInd.CreateFolder ("sFolderPath")
>     Else
>       Debug.Print "It does"
>     End If

> Any ideas why?  Thanks



Sat, 18 Sep 2004 16:12:27 GMT  
 FolderExists behavior
Dear Calvin,

You are right, there were both declaration problems and no
variable.

Thank you,

Dmitry

Quote:
>-----Original Message-----
>Hi,

>Did you declare fsInd somewhere? If so, did you use early
binding, late
>binding, or what? Your code snippet doesn't answer those
questions. You
>probably want to remove those double quotes from around
your sFolderPath
>variable too. Lastly, I think your CreateFolder line will need a
return
>variable based on examples I've seen.

>--
>Calvin Smith
>http://www.CalvinSmithSoftware.com
>"Real-world Source Code Solutions"
>***

http://www.CalvinSmithSoftware.com/CalvinSmithDoesWebsites.
htm ***

- Show quoted text -

Quote:



>> I am trying to check existence of a folder in a specified
>> directory and create one if one does not exist.  Yet, it
>> FolderExists checks for True even if nothing is there:

>>    If Not fsInd.FolderExists("sFolderPath") Then
>>       Debug.Print "it does not "
>>       fsInd.CreateFolder ("sFolderPath")
>>     Else
>>       Debug.Print "It does"
>>     End If

>> Any ideas why?  Thanks

>.



Sun, 19 Sep 2004 10:55:42 GMT  
 FolderExists behavior
Hey Dmitry!

You're welcome. Glad it worked out. :-)

--
Calvin Smith
http://www.CalvinSmithSoftware.com
"Real-world Source Code Solutions"
*** http://www.CalvinSmithSoftware.com/CalvinSmithDoesWebsites.htm ***


Quote:
> Dear Calvin,

> You are right, there were both declaration problems and no
> variable.

> Thank you,

> Dmitry
> >-----Original Message-----
> >Hi,

> >Did you declare fsInd somewhere? If so, did you use early
> binding, late
> >binding, or what? Your code snippet doesn't answer those
> questions. You
> >probably want to remove those double quotes from around
> your sFolderPath
> >variable too. Lastly, I think your CreateFolder line will need a
> return
> >variable based on examples I've seen.

> >--
> >Calvin Smith
> >http://www.CalvinSmithSoftware.com
> >"Real-world Source Code Solutions"
> >***
> http://www.CalvinSmithSoftware.com/CalvinSmithDoesWebsites.
> htm ***



> >> I am trying to check existence of a folder in a specified
> >> directory and create one if one does not exist.  Yet, it
> >> FolderExists checks for True even if nothing is there:

> >>    If Not fsInd.FolderExists("sFolderPath") Then
> >>       Debug.Print "it does not "
> >>       fsInd.CreateFolder ("sFolderPath")
> >>     Else
> >>       Debug.Print "It does"
> >>     End If

> >> Any ideas why?  Thanks

> >.



Sun, 19 Sep 2004 16:04:18 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. FolderExists/CreateFolder VB Methods

2. using FileSystemObject FolderExists for remote driver

3. VBNet - FolderExists Function - Returns False for Drive only

4. using FileSystemObject FolderExists for remote dir?

5. FolderExists & CreateFolder

6. Help with FolderExists

7. If folderexists overwrite

8. FolderExists reports true on a network share when I have no access

9. Can't access folders on the network with FolderExists method

10. Problème intermittant avec la commande FolderExists

11. Queer Query Behavior

12. Inconsistent Query Behavior

 

 
Powered by phpBB® Forum Software