Tracing connections to a linked back end mdb

R

Robin Guest

I have a small (10) group of users on a database and get
frequent (3 to 5 per week) corruptions of the back-end.

I (alone) have a facility to see who is connected using
the OpenSchema (Fields 0, 2 & 3). This gives a 'Suspect
state' output, which may help with my faultfinding.

The problem is than when the back-end db crashes it will
not accept any new connections but existing connections
are serviced. The problem with my code

Private Sub Form_Open(Cancel As Integer)
Dim cnn As New ADODB.Connection
Dim rstOC As New ADODB.Recordset
Dim rstUC As ADODB.Recordset

DoCmd.RunSQL "DELETE * FROM tblUsersConnected"

Set rstUC = New ADODB.Recordset

cnn.Provider = "Microsoft.Jet.OLEDB.4.0"
cnn.Open "Data Source=MyMDB"

Set rstOC = cnn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

'Output the list of all users in the current database.

rstUC.Open "SELECT * From tblUsersConnected",
CurrentProject.Connection, adOpenDynamic, adLockOptimistic

While Not rstOC.EOF
rstUC.AddNew
rstUC!fldComputerName = rstOC.Fields(0)
rstUC!fldConnectStatus = IIf(rstOC.Fields(2) =
True, "True", "False")
rstUC!fldSuspectState = IIf(IsNull(rstOC.Fields
(3)), "Null", rstOC.Fields(3))
rstOC.MoveNext
rstUC.Update
Wend

rstOC.Close
rstUC.Close
Set rstOC = Nothing
Set rstUC = Nothing
cnn.Close
Set cnn = Nothing

End Sub

.... is that it makes a new connection to the back-end
database which, if the back-end has crashed obviously
fails.

Is there a way of obtaining connection information to the
back-end using the front-end connection?

The front-end uses links to the tables in the back-end.

Thanks for reading this far.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top