จากกระทู้นี้
https://www.thai-access.com/yeadram_view.php?topic_id=2878ที่ อ.Yeadram ตอบ ถ้าผมต้องการให้คง comma ไว้ผมต้องแก้ไขส่วนไหนครับ
ตัวอย่าง ก่อนใส่ code นี้ Export ได้ "A",1234,"B" หลังใส่ Code นี้ได้ A1234B ที่ต้องการคือ A,1234,B พอจะเห็นภาพไหมครับ
Sub Txxxxxx()
dim conn as new adodb.connection
dim rs as new adodb.recordset
dim sq as string
dim i, j as integer
set conn = currentproject.connecion
rs.open "qryReportTextfile", conn, 1
if not rs.eof then
rs.movelast
rs.movefirst
j = rs.fields.count-1
open "C:\sbank.txt" for output as #1
do while not rs.eof
sq = ""
for i = 0 to j
sq= sq & rs(i)
next
Print #1, sq
rs.movenext
loop
close #1
end if
rs.close
set rs= nothing
set conn = nothing
end sub