PC Review


Reply
Thread Tools Rate Thread

check for network connection

 
 
Anthony
Guest
Posts: n/a
 
      23rd Jan 2009
I have a database where the tables are on a remote MS SQL server. I have to
connect to the server when I start the DB. Is there a command in VB you can
use the will check some Microsoft O/S flag to tell you if you are connected
to a network?Right now what I am doing is trying to connect to the network,
if it tries for 30 seconds and can't connect, it gives me an error # that I
use to tell if I am connected to the network. It would be nice if there was
a O/S flag that was set/not set when you are not connected to a network,
without having to first try to connect to the network. That way, you can
save 30 seconds trying to connect.

Thanks
 
Reply With Quote
 
 
 
 
Dale Fye
Guest
Posts: n/a
 
      23rd Jan 2009
There is an API call that will return a list of the mapped drives, with their
UNC designation. See the code at:

http://www.mvps.org/access/api/api0003.htm
--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"Anthony" wrote:

> I have a database where the tables are on a remote MS SQL server. I have to
> connect to the server when I start the DB. Is there a command in VB you can
> use the will check some Microsoft O/S flag to tell you if you are connected
> to a network?Right now what I am doing is trying to connect to the network,
> if it tries for 30 seconds and can't connect, it gives me an error # that I
> use to tell if I am connected to the network. It would be nice if there was
> a O/S flag that was set/not set when you are not connected to a network,
> without having to first try to connect to the network. That way, you can
> save 30 seconds trying to connect.
>
> Thanks

 
Reply With Quote
 
Anthony
Guest
Posts: n/a
 
      23rd Jan 2009
Thanks. I don't know if mapped drives it what I want. I want to know if I
am connected to the LAN/WAN regardless of whether I have any mapped network
drives.

"Dale Fye" wrote:

> There is an API call that will return a list of the mapped drives, with their
> UNC designation. See the code at:
>
> http://www.mvps.org/access/api/api0003.htm
> --
> HTH
> Dale
>
> email address is invalid
> Please reply to newsgroup only.
>
>
>
> "Anthony" wrote:
>
> > I have a database where the tables are on a remote MS SQL server. I have to
> > connect to the server when I start the DB. Is there a command in VB you can
> > use the will check some Microsoft O/S flag to tell you if you are connected
> > to a network?Right now what I am doing is trying to connect to the network,
> > if it tries for 30 seconds and can't connect, it gives me an error # that I
> > use to tell if I am connected to the network. It would be nice if there was
> > a O/S flag that was set/not set when you are not connected to a network,
> > without having to first try to connect to the network. That way, you can
> > save 30 seconds trying to connect.
> >
> > Thanks

 
Reply With Quote
 
Daniel Pineault
Guest
Posts: n/a
 
      23rd Jan 2009
You could use the code found at

http://vbnet.mvps.org/index.html?cod...tworkalive.htm

to test your network connection. Did it for me instantaneously!

Another alternative is to perform a dir() check of a known path on the
network, but then you still have a time out wait, but it isn;t normally 30
seconds. I still think option 1 is a better approach though.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"Anthony" wrote:

> Thanks. I don't know if mapped drives it what I want. I want to know if I
> am connected to the LAN/WAN regardless of whether I have any mapped network
> drives.
>
> "Dale Fye" wrote:
>
> > There is an API call that will return a list of the mapped drives, with their
> > UNC designation. See the code at:
> >
> > http://www.mvps.org/access/api/api0003.htm
> > --
> > HTH
> > Dale
> >
> > email address is invalid
> > Please reply to newsgroup only.
> >
> >
> >
> > "Anthony" wrote:
> >
> > > I have a database where the tables are on a remote MS SQL server. I have to
> > > connect to the server when I start the DB. Is there a command in VB you can
> > > use the will check some Microsoft O/S flag to tell you if you are connected
> > > to a network?Right now what I am doing is trying to connect to the network,
> > > if it tries for 30 seconds and can't connect, it gives me an error # that I
> > > use to tell if I am connected to the network. It would be nice if there was
> > > a O/S flag that was set/not set when you are not connected to a network,
> > > without having to first try to connect to the network. That way, you can
> > > save 30 seconds trying to connect.
> > >
> > > Thanks

 
Reply With Quote
 
Anthony
Guest
Posts: n/a
 
      23rd Jan 2009
Thanks. After writing my original note, I was search some more and came
across a response written by the VB genius Douglas Steele. His response
pointed me to that website also. The code on the website needs quite a bit
of tweaking to work because it is not written for use in Access. Field names
are referred to differently in Access, you need to be careful on the order
of the code posted to the form and you need to have some "know-how" on
creating a form and matching the VB field names with the form field names.
Bottom line: I used the code, did the tweaking and it works. This will help
a lot.

Thanks.

"Daniel Pineault" wrote:

> You could use the code found at
>
> http://vbnet.mvps.org/index.html?cod...tworkalive.htm
>
> to test your network connection. Did it for me instantaneously!
>
> Another alternative is to perform a dir() check of a known path on the
> network, but then you still have a time out wait, but it isn;t normally 30
> seconds. I still think option 1 is a better approach though.
> --
> Hope this helps,
>
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "Anthony" wrote:
>
> > Thanks. I don't know if mapped drives it what I want. I want to know if I
> > am connected to the LAN/WAN regardless of whether I have any mapped network
> > drives.
> >
> > "Dale Fye" wrote:
> >
> > > There is an API call that will return a list of the mapped drives, with their
> > > UNC designation. See the code at:
> > >
> > > http://www.mvps.org/access/api/api0003.htm
> > > --
> > > HTH
> > > Dale
> > >
> > > email address is invalid
> > > Please reply to newsgroup only.
> > >
> > >
> > >
> > > "Anthony" wrote:
> > >
> > > > I have a database where the tables are on a remote MS SQL server. I have to
> > > > connect to the server when I start the DB. Is there a command in VB you can
> > > > use the will check some Microsoft O/S flag to tell you if you are connected
> > > > to a network?Right now what I am doing is trying to connect to the network,
> > > > if it tries for 30 seconds and can't connect, it gives me an error # that I
> > > > use to tell if I am connected to the network. It would be nice if there was
> > > > a O/S flag that was set/not set when you are not connected to a network,
> > > > without having to first try to connect to the network. That way, you can
> > > > save 30 seconds trying to connect.
> > > >
> > > > Thanks

 
Reply With Quote
 
pietlinden@hotmail.com
Guest
Posts: n/a
 
      23rd Jan 2009
On Jan 23, 4:04*pm, Anthony <Anth...@discussions.microsoft.com> wrote:
> Thanks. *After writing my original note, I was search some more and came
> across a response written by the VB genius Douglas Steele. *His response
> pointed me to that website also. *The code on the website needs quite abit
> of tweaking to work because it is not written for use in Access. *Fieldnames
> are referred to differently in Access, *you need to be careful on the order
> of the code posted to the form and you need to have some "know-how" on
> creating a form and matching the VB field names with the form field names.. *
> Bottom line: *I used the code, did the tweaking and it works. *This will help
> a lot.


Well, that's because Access VBA and VB6 libraries are *different*. No
control arrays in Access, etc. And Randy uses Controls arrays all the
time in his code. Once you figure out how to get around that,
everything gets MUCH easier.



 
Reply With Quote
 
Anthony
Guest
Posts: n/a
 
      27th Jan 2009
One thing I noticed after creating the network connection tester, it takes
about 2 minutes for the tester to recognize I have an active connection.
Even worse, it takes about 3 minutes for it to recognize I have LOST my
connection. Would anyone know how to speed up that process?

Thanks

"(E-Mail Removed)" wrote:

> On Jan 23, 4:04 pm, Anthony <Anth...@discussions.microsoft.com> wrote:
> > Thanks. After writing my original note, I was search some more and came
> > across a response written by the VB genius Douglas Steele. His response
> > pointed me to that website also. The code on the website needs quite a bit
> > of tweaking to work because it is not written for use in Access. Field names
> > are referred to differently in Access, you need to be careful on the order
> > of the code posted to the form and you need to have some "know-how" on
> > creating a form and matching the VB field names with the form field names..
> > Bottom line: I used the code, did the tweaking and it works. This will help
> > a lot.

>
> Well, that's because Access VBA and VB6 libraries are *different*. No
> control arrays in Access, etc. And Randy uses Controls arrays all the
> time in his code. Once you figure out how to get around that,
> everything gets MUCH easier.
>
>
>
>

 
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
Network Connection Check MEGANATHANM Microsoft Dot NET Compact Framework 0 14th Dec 2009 02:59 PM
how do i check the network connection status =?Utf-8?B?SGF5ZXM=?= Microsoft VC .NET 1 5th Sep 2007 01:47 AM
Cannot check status of any network connection? =?Utf-8?B?REpheSBMZW9ub3M=?= Windows XP General 2 15th Dec 2005 03:18 AM
check network connection Thomas Microsoft VB .NET 2 22nd Jan 2005 11:09 AM
In VBA check for ODBC or Network Connection Lee T. Microsoft Access Form Coding 2 27th Jan 2004 11:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:37 AM.