If e.Name = "users" Then Dim flag As Boolean = False If TryConnectHost("192.168.37.160") Then If Network.Ping("192.168.37.160") = True Then If Connections.TryConnect(局域内网线数据源1) Then e.ConnectionString = 局域内网线数据源1 flag = True End If End If End If If flag = False Then e.ConnectionString = 本机数据源 End If End If