Solved

Checking if a folder exists on a SAMAB Server using API Function

Posted on 2003-10-24
10
232 Views
Last Modified: 2010-05-01
HI
I am using the filesystem function: FolderExists in VB 6 to determin if network share exists on a SAMAB Server : \\share
The FolderExists  function returns false, but the sahre exists (I can view it, copy to it, delete, etc... using Win explorer).
Is there a similar API function (With example) that I could use to check the samba share?

Thanks for your help
0
Comment
Question by:gfahd1
  • 4
  • 3
  • 3
10 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9616508
Have you tried Dir

if Dir("\\servername\sharename",vbDirectory) <> "" Then
    Msgbox "Share Exists"
Else
   MsgBox "Share Does Not Exist"
End if
0
 

Author Comment

by:gfahd1
ID: 9616643
I did try Dir, but didn't work either.
It is not really a folder, I am checking the main root of the SAMBA share server to see if it is accessible.

Thanks
0
 
LVL 28

Assisted Solution

by:vinnyd79
vinnyd79 earned 50 total points
ID: 9616785
Yes,but you must specify a servername as well as the sharename.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9617578
Vinnyd is absolutely right, you most specy server name AND share name
0
 

Author Comment

by:gfahd1
ID: 9628551
Hello,
Specifying a share name as well as a server name works fine. I thought there might be a way to check if the server exists, before I try to access the share. I might be wrong with my assumption.

Thanks
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9628571
You are wrong in assuming thay you can check the server in that manner.You can however check the server by pinging it assuming you are not blocking icmp packets.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9628609
But that's no problem, since you can access the sahre server exists, or am i wrong?
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 50 total points
ID: 9628628
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9628643
My previous comment wasn't for you, Vinnyd :)
0
 

Author Comment

by:gfahd1
ID: 9628754
Thanks All for your help,
Richie, NetServerEnum will do the trick.

Thanks Again
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question