Hello all.
I developed an application that is distributed over network.
Application checks if network connection to server is present and then it adjusts it's behaviour -> Server or Local Save, with my pretty advanced code
:
Now, this all works fine, but one thing:
That is following problem -> If on Workstation I choose to disable network connection via Network Connections -> Select LAN and Disable it, this should behave as 'HARDVARE FAILIURE' AND RETURN 2. But, instead of that, this rs.update to check if server DB is accessible only, remains in memory as DELAYED UPDATE, and it returns 1 (connection OK).
Frankly, I never heard of such thing.
Therefore, my code doesn't work as it should, in case when network connection is purpously disabled.
Can anyone help me with any idea?
Thanks.
I developed an application that is distributed over network.
Application checks if network connection to server is present and then it adjusts it's behaviour -> Server or Local Save, with my pretty advanced code
Code:
Public Function checkLink_M() As Integer
'Returns 1 - link is OK, 2 - physical (hardware)interruption, 3 - application (coding error) interruption
'connDBMAIN is Public Link
Dim rs As DAO.Recordset
If Not (connDbMAIN Is Nothing) Then 'ldb is existing
On Error GoTo err_conn_2
Set rs = connDbMAIN.OpenRecordset("SER_SYS_LINK")
rs.MoveFirst
rs.Edit
rs!link = 1
rs.Update
rs.Close
'CONN IS OK, NO ERRORS triggered
checkLink_M = 1
Else
'SOFTWARE Error - code colapsed ldb
checkLink_M = 3
End If
Set rs = Nothing
EXIT_F:
Exit Function
err_conn_2:
Set rs = Nothing
'HARDWARE COLAPSED PHYSICAL CONNECTION (cable unplugged, disk errors, network failiures, network disabled, Server crushed,...)
checkLink_M = 2
Resume EXIT_F
End Function
Now, this all works fine, but one thing:
That is following problem -> If on Workstation I choose to disable network connection via Network Connections -> Select LAN and Disable it, this should behave as 'HARDVARE FAILIURE' AND RETURN 2. But, instead of that, this rs.update to check if server DB is accessible only, remains in memory as DELAYED UPDATE, and it returns 1 (connection OK).
Frankly, I never heard of such thing.
Therefore, my code doesn't work as it should, in case when network connection is purpously disabled.
Can anyone help me with any idea?
Thanks.