PC Review


Reply
Thread Tools Rate Thread

Checking the connection to a network Share

 
 
KC
Guest
Posts: n/a
 
      18th Apr 2008
I have a VBA macro that write to a network share however I have two problems.
1: The user is prompted to enter a username and password. I would like to
place this in the macro.
2: I can't reference the computer with the shared folder by name and need to
use the IP address. I would like to check the connection to the share before
copying the file. In the past I use code like this:
Dim Coll_Docs As New Collection
Dim strSearch_path, strSearch_Filter, strSearch_Fullname As String
Dim strDocName As String
strSearch_path = strSharePath
strSearch_Filter = "*.*" 'what files
Set Coll_Docs = Nothing
strDocName = Dir(strSearch_path & "\" & strSearch_Filter)
Do Until strDocName = "" ' build the collection
Coll_Docs.Add Item:=strDocName
strDocName = Dir
Loop
intShareTest = Coll_Docs.Count

it is a crude but if intsharetest is >0 then it has connected to the drive
and sees the other files in the shared folder. This works if strSharePath
="//conputername/foldername" but doesn’t work using "//ipaddress/foldername".
I need a test that uses the IP address. Thanks,
--
KC
 
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
RE: Network share checking help Anteaus Windows XP Networking 0 6th Aug 2009 09:11 AM
directory.exists occassionally locks up when checking network share Keith Langer Microsoft Dot NET Framework 8 3rd Sep 2006 03:49 PM
Checking if you have a network connection clayton Microsoft Excel Misc 0 31st May 2006 04:31 PM
best way to share dsl connection on xp home network? tim Windows XP Networking 3 10th Sep 2003 02:12 PM
Checking for Network Connection? Brian Shafer Microsoft Access VBA Modules 1 17th Jul 2003 11:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:16 PM.