一直问问题,受惠于foxtable,也来反馈服务下大家:
Dim str1 As String
Dim str2 As String
Dim 变量名1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim 变量名2 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
str1 =变量名1.Text
str2 =变量名2.Text
Connections.Add(str1,"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & str2 & ";Persist Security Info=False")
For Each item As String In Connections(str1).GetTableNames
msgbox(item)
Next
测试有效