参考代码
Dim t As Table = CurrentTable
Dim str_oleConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\test.mdb;Persist Security Info=False"
Dim ole_conn As New System.Data.OleDb.OleDbConnection(str_oleConn)
Try
ole_conn.Open()
Dim str As String = "_Identify AUTOINCREMENT PRIMARY KEY,"
For Each c As Col In CurrentTable.cols
str &= c.name & " char(16),"
Next
output.show(str)
Dim cmd1 As New System.Data.OleDb.OleDbCommand("Create Table " & t.name & " (" & str.Trim(",") & ")", ole_conn)
cmd1.ExecuteNonQuery()
For Each r As Row In t.rows
str = "'" & r("_Identify") & "',"
For Each c As Col In t.cols
str &= "'" & r(c.name) & "',"
Next
Dim cmd2 As New System.Data.OleDb.OleDbCommand("Insert Into " & t.name & " values (" & str.Trim(",") & ")", ole_conn)
output.show(str)
cmd2.ExecuteNonQuery()
Next
msgbox("保存成功")
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
ole_conn.Close()
End Try