Results 1 to 2 of 2

Thread: How to get data from table to write to a txt file?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Location
    Madison, WI
    Posts
    136

    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
    Last edited by callydata; Sep 14th, 2005 at 03:58 PM. Reason: forgot somehting

  2. #2
    Fanatic Member kaihirst's Avatar
    Join Date
    Jul 2005
    Location
    The Resaurant At the End of The Universe
    Posts
    633

    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
    As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..

    A few things that make a good Developer a Great One.
    Methodical and a thorough approach to research and design inevitably leads to success.
    Forward thinking is the key to Flow of control.
    Never test in the design environment, always test in real time, you get the REAL results.
    CBSE & OOSE are the same animal, they just require different techniques, and thinking.
    SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
    The key to good design is explicit attention to both detail and response.
    Think Freely out of the "Box" you're in..... You will soar to better heights.

    Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width