BeforeConnectOuterDataSource
msgbox(e.name)
If e.name = "数据源1" Then Dim s As String = "连接字符串1" If Connections.TryConnect(s) = False Then MessageBox.Show("数据源无法连通!") s = "连接字符串2" End If e.ConnectionString = s End If