views:

77

answers:

1

I am creating a sql query for an access database that will be exported to a text file. The requirements include a line feed separating each line. Does that happen by default, or its something that I need to add in? If I need to add it, how do I do that?

TIA

+1  A: 

TransferText includes LineFeed and I am fairly sure most methods of getting text out of Access will include linefeed, unless you do something to stop it. It is not too difficult to check.

Dim fs As New FileSystemObject

s = "c:\docs\test.txt"
DoCmd.TransferText acExportDelim, , "query6", s
Set f = fs.OpenTextFile(s)
a = f.ReadAll

''Split at linefeed: Chr(10)
aa = Split(a, Chr(10))

''Test 1
Debug.Print UBound(aa)

''Test 2
For Each itm In aa
    Debug.Print itm
Next
Remou
Actually, it's Cr/Lf, not just Lf, because that's the standard for line termination on Windows. I kind of assumed that since the question asked for Lf only that the target system was not Windows (can't remember whether it's Mac or Linux that uses Lf only).
David-W-Fenton