Permalink
Browse files

ExportTable: fix failure of translating \n and \t and simplified

  • Loading branch information...
bkidwell committed Apr 1, 2013
1 parent 30a4aea commit b9408b62f21a8a5eec51eacb799fbc06155ac67c
Showing with 3 additions and 4 deletions.
  1. +3 −4 AppCodeImportExport.bas
View
@@ -543,7 +543,7 @@ Private Sub ExportTable(tblName As String, obj_path As String)
Set fso = CreateObject("Scripting.FileSystemObject")
' open file for writing with Create=True, Unicode=True (USC-2 Little Endian format)
MkDirIfNotExist obj_path
- Set OutFile = fso.CreateTextFile(obj_path & tblName & ".us2", True, True)
+ Set OutFile = fso.CreateTextFile(TempFile(), True, True)
Set rs = CurrentDb.OpenRecordset("export_" & tblName)
C = 0
@@ -570,16 +570,15 @@ Private Sub ExportTable(tblName As String, obj_path As String)
Value = Replace(Value, vbLf, "\n")
Value = Replace(Value, vbTab, "\t")
End If
- OutFile.write CStr(Nz(rs(fieldObj.Name), ""))
+ OutFile.write Value
Next
OutFile.write vbCrLf
rs.MoveNext
Loop
rs.Close
OutFile.Close
- ConvertUcs2Utf8 obj_path & tblName & ".us2", obj_path & tblName & ".txt"
- Kill obj_path & tblName & ".us2"
+ ConvertUcs2Utf8 TempFile(), obj_path & tblName & ".txt"
End Sub
' Import the lookup table `tblName` from `source\tables`.

0 comments on commit b9408b6

Please sign in to comment.