(1)切换数据源命令
vars("conn") = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source =" & dis_project & ";Persist Security Info=False;Jet OLEDB:Database Password=c5tfC+O_(X6&5iw5"
Syscmd.Project.Open(ProjectFile, vars("conn"))
(2)BeforeConnectOuterDataSource事件:
If e.name = "project" Then
If OpenFileArgs.Count = 0 Then
e.C & e.ProjectPath & "pro.mox;Persist Security Info=False;Jet OLEDB:Database Password=c5tfC+O_(X6&5iw5"
Else
'然后设置成新的数据库.
e.ConnectionString = OpenFileArgs(0)
End If
endif
我是这样切换数据源的,请问这样是否妥当?还需要做其他工作吗?