Dim dlg As New OpenFileDialog
dlg.Filter = "Access文件|*.mdb"
dlg.MultiSelect = True '允许选择多个文件
If dlg.ShowDialog =DialogResult.OK Then
For Each fl As String In dlg.FileNames
Dim pwd As String
If InputPassWord(pwd,"提示","请输入密码:") Then
If Connections.Contains("test") Then Connections.Delete("test")
Connections.Add("test","Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fl & ";Persist Security Info=True;Password=" & pwd )
For Each tn As String In Connections("test").GetTableNames
Dim mg As New Merger
mg.SourcePath = fl
mg.SourceTableName = tn
mg.DataTableName = tn
mg.Merge()
Next
End If
Next
End If
为什么总是提示:创建外部连接“test"失败?