ExpAccessToAscii



Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(yourdatabasename)
Set rs = db.OpenRecordset(yourtablename)
'step 3:

Dim nFile%
Dim vFileName$
'vFileName$ = the name and location of the text file

nFile% = FreeFile
Open vFileName$ For Output As #nFile%
'step 4 / 5:

Dim counter%
Dim MaxFields%
MaxFields% = rs.Fields.Count - 1
Do While Not rs.EOF
For counter% = 0 To MaxFields%
If Not IsNull(rs.Fields(counter%).Value) Then _
Print #nFile, rs.Fields(counter%).Value
Next counter%
rs.MoveNext
Loop
'step 6:

rs.Close
db.Close
Close #nFile%
'This way you get all the value on a different line in your textfile.

'If you want the record on one line just change step 4/5 to

Dim counter%
Dim MaxFields%
MaxFields% = rs.Fields.Count - 1
Do While Not rs.EOF
For counter% = 0 To MaxFields%
If Not IsNull(rs.Fields(counter%).Value) Then _
Print #nFile, rs.Fields(counter%).Value;
Next counter%
Print #nFile,
rs.MoveNext
Loop

(expaccesstoascii.html)- by Paolo Puglisi - Modifica del 25/3/2019