'链接动态数据源,动态数据源不能设置表属性等代码.
Dim cmd As New SQLCommand
cmd.ConnectionName = "系统数据"
Dim dt As DataTable
cmd.CommandText = "Select * From {动态数据源} Where [是否加载] = True"
dt = cmd.ExecuteReader()
For Each dr As DataRow In dt.DataRows
If dr.IsNull("密码") Then
e.C & e.ProjectPath & dr("动态数据源") & ".mdb;Persist Security Info=False"
Else
e.C & e.ProjectPath & dr("动态数据源") & ".mdb;Persist Security Info=False;Jet OLEDB:Database Password=" & dr("密码")
End If
Next