Solved

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

Posted on 2003-10-24
10
228 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
Comment Utility
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
Comment Utility
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
Comment Utility
Yes,but you must specify a servername as well as the sharename.
0
 
LVL 16

Expert Comment

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

Author Comment

by:gfahd1
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 28

Expert Comment

by:vinnyd79
Comment Utility
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
Comment Utility
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
Comment Utility
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
My previous comment wasn't for you, Vinnyd :)
0
 

Author Comment

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

Thanks Again
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now