![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have this code in Access 2003 for checking if an Internet connection is present: (In the code below, "somedomain" represents the web site that is used to check for the update. I have substituted other domains in to test it.) ************************************************** ******* Private Const FLAG_ICC_FORCE_CONNECTION = &H1 Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" _ (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long Code in the Form_Load Event: If InternetCheckConnection("http://www.somedomain.com/", FLAG_ICC_FORCE_CONNECTION, 0&) = 0 Then MsgBox "No Internet connection to the update site.", vbOKOnly + vbInformation, "Help." else ' do the update check. endif ************************************************** ******************* It works when I am at home directly connected to the Internet through a cable modem and router, but when I run it at work where I connect to the Internet through the LAN I get the "No Internet Connection" message and the update check does not run. There is an internet connection available at work - that is where I have typed this. Is there another way to determine if there is an Internet connection? Many thanks Anthony |
#3
| |||
| |||
|
|
Hi, The last sample code on this site correctly displays that I'm connected via LAN: http://vbcity.com/forums/faq.asp?fid=10&cat=Networking Regards Jens Hi, [quoted text clipped - 38 lines] Anthony |
![]() |
| Thread Tools | |
| Display Modes | |
| |