# Trouble with FolderItems and Network Drive

**URL:** <https://forum.xojo.com/t/trouble-with-folderitems-and-network-drive/37108>\
**Category:** General\
**Created:** [April 9, 2017, 6:12pm UTC](https://forum.xojo.com/t/trouble-with-folderitems-and-network-drive/37108 "2017-04-09T18:12:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Cullins](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/73ab20/32.png) [@David\_Cullins](https://forum.xojo.com/u/David_Cullins)\
**Post date:** [April 9, 2017, 6:12pm UTC](https://forum.xojo.com/t/trouble-with-folderitems-and-network-drive/37108/1 "2017-04-09T18:12:14Z")

</div>

I am having trouble accessing a network drive.

the path is generated by “OpenDialog” routine which allows the user to choose the folder.  
that does exist.

In win7 for example the folder returned by OpeDialog is:  
\\RouterName\DD1\_DB\culser

in Mac the folder returned is:  
/Volumes/NDD1/\_DB/culser where NDD1 is the network drive.

The OpenDialog routine return the “\” double backslash for windows instead of “\etwork”

Assuming on the network drive folders are broken up in to “Folders()” array  
the following routine fails when i = 1/ and folder(1) = NDD1

```auto
Root = GetFolderItem(Folders(0))

For i As Integer = 1 To Folders.Ubound
  Root = Root.Child(Folders(i))
  if Root <> Nil and Root.Exists Then
    continue
  else
    MsgBox "I: " + str(i) + " folder: " + Folders(i)
    Return Nil
  End If
Next
```

This forum talked about rebuilding network drive FolderItem but did not go into much detail how to do that.  
[https://forum.xojo.com/29354-retaining-folderitem-for-file-on-external-drive/0#p240868](https://forum.xojo.com/29354-retaining-folderitem-for-file-on-external-drive/0#p240868)

Note: this routine works great on non network drives.

please advise …

---

<div class="post-metadata">

**Author:** ![Thomas\_Tempelmann](https://forum.xojo.com/user_avatar/forum.xojo.com/thomas_tempelmann/32/315_2.png) [@Thomas\_Tempelmann](https://forum.xojo.com/u/Thomas_Tempelmann)\
**Post date:** [April 9, 2017, 10:11pm UTC](https://forum.xojo.com/t/trouble-with-folderitems-and-network-drive/37108/2 "2017-04-09T22:11:56Z")

</div>

Your explanation makes little sense to me. I suspect you build your array of FolderItems incorrectly. OpenDialog should give you a single FolderItem that already points to the selected file, even if it’s on the network. After that, you seem to decompose that FolderItem into an array, and that’s what probably is done wrong.

Why do you even do that? Why not just use the FolderItem you got? What do you need to have the single items for?

---

<div class="post-metadata">

**Author:** ![David\_Cullins](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/73ab20/32.png) [@David\_Cullins](https://forum.xojo.com/u/David_Cullins)\
**Post date:** [April 9, 2017, 10:57pm UTC](https://forum.xojo.com/t/trouble-with-folderitems-and-network-drive/37108/3 "2017-04-09T22:57:56Z")

</div>

ah that’s right

i was thinking that all children have to be checked for Nil and if they exist, but  
in the case of OpenDialog - that is already returning existing folders …

gee am i a dope

sorry for that and thank you…

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:43pm UTC](https://forum.xojo.com/t/trouble-with-folderitems-and-network-drive/37108/4 "2020-10-29T18:43:27Z")

</div>


