Dim cs As String = "身份证号,学生姓名,班级,座号"
Dim lm As String
For Each dc As DataCol In DataTables("成绩汇总").DataCols
If dc.Name.Length = 2 AndAlso cs.Contains(dc.Name) = False Then
lm &= dc.name & ","
End If
Next
Dim ex As New Exporter
ex.SourceTableName = "成绩汇总"
ex.FilePath = ProjectPath & "Reports\成绩汇总111.mdb"
ex.Fields = cs & "," & lm.Trim(",")
msgbox(ex.fields)
If FileSys.FileExists(ex.FilePath) Then '如果目标文件已经存在
FileSys.DeleteFile(ex.FilePath) '则删除之
End If
ex.Export()