编码导入:
http://www.foxtable.com/help/topics/2334.htm
例如:
Dim Book As New XLS.Book("c:\test\订单.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Tables("订单").StopRedraw()
'注意以下数组中列名称的顺序,必须和Excel表中的列顺序一致
Dim nms() As String = {"编号","产品","客户","雇员","单价","折扣","数量","日期"}
For n As Integer = 1 To Sheet.Rows.Count -1
Dim txt As String = Sheet(n,0).Text
If DataTables("订单").Find("编号 = '" & txt & "'") Is Nothing Then '假定编号是字符型,判断同编号是否已经存在。
Dim r As DataRow = DataTables("订单").AddNew()
For m As Integer = 0 To nms.Length - 1
r(nms(m)) = Sheet(n,m).Value
Next
End If
Next
Tables("订单").ResumeRedraw()
[此贴子已经被作者于2012-10-29 20:55:28编辑过]