Dim conn As ADODB.Connection
Dim WN As String
Dim OldTableName As String
Dim NewTableName As String
Dim sSql As String
Dim tStr As String
OldTableName = "经手人表"
NewTableName = "test"
tStr = "钢笔"
conn.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;" & _
"Data Source=C:\" & WN
conn.Open
If conn.State = adStateOpen Then
sSql = "Insert Into " & NewTableName & " Select * From " & OldTableName & " "
conn.Execute sSql
MsgBox "成功把“" & OldTableName & "”中的所有的“" & tStr & "”记录汇总到“" & NewTableName & "”中!", , "http://excelba.com"
conn.Close
End If
Set conn = Nothing