function txtHeader(aRecordset)
dim s, i
s = ""
for i = 0 to aRecordset.Fields.count - 1
if s <> "" then s = s & vbTab
s = s & aRecordset.fields(i).Name
next
txtHeader = s
end function
function txtDataLine(aRecordSet)
dim s, i, t
s = ""
for i = 0 to aRecordSet.Fields.Count - 1
if s <> "" then s = s & vbTab
s = s & trim(aRecordSet.fields(i) & " ")
next
txtDataLine = s
end function
sub txtCursorToFile(aRecordset, aFilename)
dim fout, lFSO
set lFSO = CreateObject("Scripting.FileSystemObject")
set fout = lFSO.OpenTextFile(aFilename, 2, true)
fout.Writeline txtHeader(aRecordset)
do while not aRecordset.EOF
fout.WriteLine txtDataLine(aRecordset)
aRecordset.Movenext
loop
fout.Close
set fout = nothing
set lFSO = Nothing
end sub
lundi 27 octobre 2008
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire