Tips on General DB Deployment and/or Management (1 Viewer)

isladogs

CID VIP
Local time
Today, 19:44
Joined
Jan 14, 2017
Messages
14,777
OK - remember its not fool-proof by any means...

Open using the shift bypass
Replace the two linked tables with your own linked network table(s) and modify the code accordingly
There are two different procedures. One is mine, the other is adezii's
It will detect whether a linked network table is connected but can't tell whether Ethernet or WiFi is actually in use if both connections exist
 

Attachments

  • WiFiTEST_v2.zip
    36.7 KB · Views: 20

FrankRuperto

Member
Local time
Today, 14:44
Joined
Mar 6, 2021
Messages
182
Unfortunately nobody has yet devised code that can reliably detect with certainty when Wifi is actually being used
I thought a solution for that was recently solved by you and ADezii in a UA thread?
 

isladogs

CID VIP
Local time
Today, 19:44
Joined
Jan 14, 2017
Messages
14,777
At the time of the UA thread, I thought it worked but further tests confirmed what I wrote above.
The zip file includes that code.

Similar code was provided recently here by @arnelgp. See Solved - Confirm LAN connection. | Access World Forums (access-programmers.co.uk)
However, whilst the OP was happy with that, it also failed in exactly the same situation I have described when I tested it
 

FrankRuperto

Member
Local time
Today, 14:44
Joined
Mar 6, 2021
Messages
182
At the time of the UA thread, I thought it worked but further tests confirmed what I wrote above.
The zip file includes that code.

Similar code was provided recently here by @arnelgp. See Solved - Confirm LAN connection. | Access World Forums (access-programmers.co.uk)
However, whilst the OP was happy with that, it also failed in exactly the same situation I have described when I tested it
Hmm, there are PowerShell cmdlets for reliably detecting if ethernet is connected:
Code:
If ( (Get-NetAdapter -Name 'Ethernet').MediaConnectionState -eq 'Connected' )
See: https://devblogs.microsoft.com/scripting/use-powershell-to-disable-wi-fi/

Maybe it was not reliable because WiFi adapters are not all named the same among different computers, or adapter type enum can vary with different Win versions?
 
Last edited:

isladogs

CID VIP
Local time
Today, 19:44
Joined
Jan 14, 2017
Messages
14,777
No.
As I stated earlier, this type of code can reliably detect if a workstation has an Ethernet or Wifi connection (using searches for Wi*Fi or Wireless).
However many devices such as laptops have both available.
Testing shows that the code cannot detect reliably if Ethernet is being used for network connection when Wifi is also switched on.

If that isn't a concern, then any of this type of code would probably suffice.

Thanks for the PowerShell link
 

FrankRuperto

Member
Local time
Today, 14:44
Joined
Mar 6, 2021
Messages
182
That being said, if the main objective is to ensure that a wifi connection is not being used when opening an Access FE, then how about disabling wifi with a PS script that runs when users click on the shortcut that launches the Access FE?
 

isladogs

CID VIP
Local time
Today, 19:44
Joined
Jan 14, 2017
Messages
14,777
That may well be an acceptable solution but it would be essential to switch WiFi back on again when the app is closed.
 

FrankRuperto

Member
Local time
Today, 14:44
Joined
Mar 6, 2021
Messages
182
That may well be an acceptable solution but it would be essential to switch WiFi back on again when the app is closed.
When the FE closes, control returns to the cmd script that launched the FE and a PS command can enable the wifi.
 

JMongi

Member
Local time
Today, 14:44
Joined
Jan 6, 2021
Messages
346
Wow, you guys already worked out a possible solution I had come up with yesterday but didn't want to post about until I had done more research. There are a lot of threads on the internet about disabling WiFi when connected to the Ethernet. Many assume that plugging in an Ethernet cable automatically disables WiFi but it does not. There are a few programs that don't play nice in this "Bridged Mode" connection. Once I found an elegant solution for the "disabling WiFi" idea via powershell, then I was going to investigate incorporating that functionality into an Access based solution.

@isladogs - Thanks for posting the code and the brief how-to for modification.
 

FrankRuperto

Member
Local time
Today, 14:44
Joined
Mar 6, 2021
Messages
182
Wow, you guys already worked out a possible solution I had come up with yesterday but didn't want to post about until I had done more research. There are a lot of threads on the internet about disabling WiFi when connected to the Ethernet. Many assume that plugging in an Ethernet cable automatically disables WiFi but it does not. There are a few programs that don't play nice in this "Bridged Mode" connection. Once I found an elegant solution for the "disabling WiFi" idea via powershell, then I was going to investigate incorporating that functionality into an Access based solution.

@isladogs - Thanks for posting the code and the brief how-to for modification.
Yeh, one cannot do it all with vba inside an open Access FE. Disabling wifi and backups are recipes for corruption.
If you can't determine whether ethernet or wifi is being used for the Access table links, then temporarily disabling all network adapters except ethernet before launching the Access FE is best approach. There are devices which automatically switch from one adapter to another if the there's a bad connection. The best solution is to use RDP. If the connection goes bad, when you reconnect the screen will be at same spot when disconnection occured, and no corruption. Ethernet is not exempt from causing Access corruptions. We have a client with 12 Access users on a LAN. Although a 1GB switch was being used, some workstations had 100mbit NIC's, others had 1gbit NIC's, mixed Win7 Win10, couple workstations were 400 feet away, and they were using unshielded cables.
 
Last edited:

Users who are viewing this thread

Top Bottom