Dim s As String = e.ConnectionString
If Connections.TryConnect(s) = False Then
MessageBox.Show("数据源无法连通!")
Dim dlg As New OpenFileDialog
dlg.Filter= "Access文件|*.mdb"
If dlg.ShowDialog = DialogResult.Ok Then
Dim s1 As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dlg.FileName & ";Persist Security Info=False"
e.ConnectionString= s1
Return
End If
End If
通过以上代码在 BeforeConnectOuterDataSource 中添加, 想实现外部数据源无法访问时,手工选择数据库,但选择后只针对本次登陆有效,应该如何保存当前的配置,下次登陆继续有效?