How to get data from table to write to a txt file?
How do you write data from a table into a .txt file, the simplest way? I know this question may sound stupid to the seasoned pro, but I am having trouble wraping my brain around it. Would I declare a variable and = it to a table row? ANy ideas are appreciated.
Thanks!
p.s. I am using SQL and .NET
Re: How to get data from table to write to a txt file?
Hi,
off the top of my head, would say..
// method if you are pulling from a database table
dim fso
dim file1
function writetotext()
set fso = fso.create ("Scripting.FileSystemObject")
set file1 = OpenTextFile ("c:\file.txt", ForWriting, true)
if rqeuest.form("inserttextsubmitbutton") <> "" then
file1.writeline (request.form("textbox"))
file1.writeBlankLines(1)
if reuqest.form("closefilesubmitbutton") <> "" then
file1.close
end if
end if
end function
this wil take whatever you put into the textbox and input into a file, then close it when your ready.
play around with this code as wrote it off the top of my head, so try it.
ta
kai :wave: