16,554
社区成员
发帖
与我相关
我的任务
分享
Private Sub ExportIntoText(ItemNoTBHaveOrNot As String, TmpPath As String)
Dim FileObj As Scripting.FileSystemObject
Dim TextObj As Scripting.TextStream
Dim I As Integer
Dim Rst As DAO.Recordset
Set FileObj = CreateObject("Scripting.FileSystemObject")
Set TextObj = FileObj.CreateTextFile(TmpPath, True)
Set Rst = CurrentDb.OpenRecordset(ItemNoTBHaveOrNot)
If Not (Rst.BOF And Rst.EOF) Then
Rst.MoveLast
Rst.MoveFirst
For I = 1 To Rst.RecordCount
If Not IsNull(Rst(0)) Then
TextObj.WriteLine (Trim(Rst(0)))
End If
Rst.MoveNext
Next
Else
TextObj.Write ("-->>无记录<<--")
End If
Rst.Close
Set Rst = Nothing
TextObj.Close
Set TextObj = Nothing
Set FileObj = Nothing
End Sub