How can I check the availability of a network share through Visual Basic code 
Author Message
 How can I check the availability of a network share through Visual Basic code

Dear API Specialist(s),

I am writing a Sales Force program in Visual Basic which uses data stored on
an Access database.  The master database is located on a network server and
a replica is located on each (portable) client computer.

When starting the program I would like to check (as fast as possible) if the
master database on the network can be reached to decide if the program
should run on the master database or on the local copy.

Calling the standard Dir-function in VB only returns the not-found error
after 10 to 20 seconds.  This is too long!

Does anyone know a faster solution to my problem?!

Best regards,
Philippe



Mon, 11 Feb 2002 03:00:00 GMT  
 How can I check the availability of a network share through Visual Basic code


Fri, 19 Jun 1992 00:00:00 GMT  
 How can I check the availability of a network share through Visual Basic code
Hi Philippe,

I've seen more questions like this one before and the most given answer was
to either ping or connect to the server. Pinging a server requires some code
and isn't really nessesary. Servers are most of the time running some
additional services like e-mail serving, a proxy or whatever. By using the
Winsock controls you can try to make a connection to the server at one of
the ports at which a service should be running. Within a few seconds it will
return an error if it can't connect (and the server is down) or it connects
(the server is available). There's only a possible negative side-effect of
this. If your computer is configured for dialup networking and you have it
set to dial whenever a connection is needed, it will make a connection if
the server isn't available. But you can turn this feature off, so I think
this is a good way to accomplish what you want.

Good Luck!
Kind Regards,

Koen

** Holland, Europe **

Quote:
> Dear API Specialist(s),

> I am writing a Sales Force program in Visual Basic which uses data stored
on
> an Access database.  The master database is located on a network server
and
> a replica is located on each (portable) client computer.

> When starting the program I would like to check (as fast as possible) if
the
> master database on the network can be reached to decide if the program
> should run on the master database or on the local copy.

> Calling the standard Dir-function in VB only returns the not-found error
> after 10 to 20 seconds.  This is too long!

> Does anyone know a faster solution to my problem?!

> Best regards,
> Philippe



Thu, 14 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Check computer availability over network

2. Availability of Visual BASIC 6?

3. gif vbx, ocx & visual basic 3 availability

4. Visual Basic Script availability?

5. Availability of Visual Basic Courses in So. California

6. Visual Basic codes for Diaup Networking

7. shared variables between Visual Basic (16 bit) and Visual C++ (32-bit)

8. Convert hp basic code to visual basic code

9. Network, exploring the network environment with visual basic?

10. Crystal Reports Canned Code

11. Opening network shares from code?

12. Create / Delete Network shares from code

 

 
Powered by phpBB® Forum Software