![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Everyone, First, happy new year to you all. I hope you have had a great Christmas and holiday period. I am just this very day back at work, and already straight back to it. I am working on an application for my colleagues that pulls data from a central server (this may end up being MySQL, MSSQL, SharePoint, Oracle, SAP....... I just dont know yet!). The users will all have laptops and during the course of their day they will have mixed connectivity situations - from none to WAN to LAN, and sometimes VPN. In order to make this application work properly I need to localise a copy of the 'master data' that they will be processing. To do this I need to pull down a resultset or two and store them locally. No probs so far. My issue is in being able to determine the connected state of the laptops throughout the course of their working day. I can PING to determine the presence or absence of an IP or HOSTNAME. So far so good. Where I am stuck is in determining the media connection LINK STATE for each of the available adapters. What I would like to do is to be able to determine if there is actually a network connection at all before trying to do anything else with the app (as far as pulling updated data is concerned). If I can detect an 'UP' LINK STATE for any adapter then I can try and ping the required resource. Or maybe I am just making this too complicated? If there is a way to read this LINK STATE from the registry or some other means that would be great. I am hoping to build this into a class module that handles all the networking functionality required for the application. Cheers The Frog |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Hi Stuart, Thanks for the response. I thought about this but the problem is actually a little more subtle. What I want to ensure is that no data is fed back to the 'master' database unless the user is connected by LAN - so no VPN's, no Wireless LAN, etc... I can control for the errors that the users will introduce by doing careless things like switching the laptop off halfway through an update (inserting to the master), but it will result in loads of complaints from the users of the nature "It takes too long to do X, whinge whinge whinge.......". To avoid setting their expectations too high I need to limit it to a LAN connection only. I was doing a little research on this yesterday and came across a VBScript example that uses WMI to retrieve this information. Here is an example: http://www.eggheadcafe.com/software/...-registry.aspx You need to look about half way down the page to see the example. It seems to be able to provide a great deal of information, similar to the IPCONFIG command from a DOS prompt. I have no experience in using WMI and so I am struggling to understand the script completely. From what I do understand you need to fire a question at a WMI object similar to how you can use SQL with DAO / ADO, and then loop through the results to find what you want. Sounds like a fairly clean and standardised way to go. I am wondering if anyone has a way of interpreting that script into the SQL like query that need to be asked to WMI? The example above might work well for scripting but I need to handle the results a little differently to example. What a coincidence! Database Weekly just posted a link to a WMI Code |
#5
| |||
| |||
|
|
I am working on an application for my colleagues that pulls data from a central server (this may end up being MySQL, MSSQL, SharePoint, Oracle, SAP....... I just dont know yet!). The users will all have laptops and during the course of their day they will have mixed connectivity situations - from none to WAN to LAN, and sometimes VPN. |
#6
| |||
| |||
|
|
You could use the Dir function to check for the presence of a known file, eg GotConnection = Len(Dir("\\ServerName\DirName\FileName") > 0) |
#7
| |||
| |||
|
|
What I want to ensure is that no data is fed back to the 'master' database unless the user is connected by LAN - so no VPN's, no Wireless LAN, etc. |
#8
| |||
| |||
|
|
"Stuart McCall" <smccall (AT) myunrealbox (DOT) com> wrote in news:KjNWo.92093$SY.88759 (AT) newsfe06 (DOT) ams2: You could use the Dir function to check for the presence of a known file, eg GotConnection = Len(Dir("\\ServerName\DirName\FileName") > 0) I find that using the File System Object is more reliable than Dir(), which can error out in ways that are not helpful. It is also slow to give up, whereas the FSO method knows there's no network and returns more quickly. |
|
-- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#9
| |||
| |||
|
|
Thanks for the response. I thought about this but the problem is actually a little more subtle. What I want to ensure is that no data is fed back to the 'master' database unless the user is connected by LAN - so no VPN's, no Wireless LAN, etc... |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |