Link to home
Start Free TrialLog in
Avatar of MrAutomate
MrAutomateFlag for United States of America

asked on

How can I query the connection state of Cisco Anyconnect 2..5x with access vba

I am looking for vba code that I can use in MS Access at startup, and determine if a user is attempting to start an access tool over CISCO VPN vpn.

I found some code that tells me if I am a LAN, but that code does not tell the difference between VPN or LAN.  Access, on the other hand, let's us know very quickly, the difference.  A user attempting to connect on VPN will be disallowed.

Possibly, a registry key that indicates an active status, using the MSscripting library?  Problem is, I am far from a  cisco expert, and cannot locate any such registry entry in this version fo the VPN software.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MrAutomate

ASKER

Jim,

Thanks for this.  I have tested from my LAN connected desktop, and it works without issue.  

However, when connected to my laptop, via the CISCO vpn software listed above, the code causes ACCESS to crash every time, when it gets to the adapter name section, which I was hoping would be the very section that would help me identify if it was not a lan connection.  Any thoughts on code tweaks that might correct this?
<<the code causes ACCESS to crash every time, when it gets to the adapter name section, which I was hoping would be the very section that would help me identify if it was not a lan connection.  Any thoughts on code tweaks that might correct this? >>

  Sorry but no.  The code has worked fine wheneve I've used it.  Is the laptop running the same OS or something different?

Jim.
JIm,

Same OS, however, encrtion is present on the Laptops hard disk, if that matters.  I suspect the VPN client might cause the crash when / if polled.  Is that possible?

  Maybe, although I have used that on machines with different VPN clients and never had an issue.  Of course I haven't used that code all that often, so I can say with certainty it works in all cases.

Jim.
Jim,

Thanks.  Tried other laptops, same issue, fails at the same point.  Let me go ahead and get you the points, you were responsive, and gave a cool solution,even though it did not work for our laptops.
This is good code for detailing LAN connection information, although it did nto seem to work on HP laptop with encrypted hard disks, running windows XP, and Cisco any connect vpn clients.