Downloading a recordset

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Re: Downloading a recordset

    You can pull the whole recordset into a variable using rs.GetString(),
    formatted as .csv if you want. This example pulls in a recordset as a
    table, but you can pretty easily convert to a .csv file:
    [url]http://www.learnasp.com/learn/dbtablegetstring.asp[/url]

    "Mitchell Nussbaum" <nussbm@dnr.state.wi.us> wrote in message
    news:eGSwYJGWDHA.652@tk2msftngp13.phx.gbl...
    > I have an .asp application that retrieves a table into an ADO
    recordset and
    > retrieves it as an HTML table.
    >
    > I would like to give users the option of downloading the contents of
    the
    > recordset as a .csv file, but I can't figure out how to do that. I've
    found
    > examples of code that download pre-existing files from the server to
    the
    > desktop, but I'd prefer not to have the script write a file on the
    server if
    > possible. So I'd like to construct the .csv records line by line, and
    send
    > them to a specified file on the client machine.
    >
    > Is there a way to do this? Or is there some other solution to my
    problem?


    Kris Eiben Guest

  2. Similar Questions and Discussions

    1. Help with downloading
      When downloading the scren says that i may need to click on the gold bar on the top of the browser screen to allow the download to complete, i am...
    2. Help before downloading
      I would like to know before I download, I am making a fan club site for my friend, and I want to add a music player (like the ones on myspace...
    3. Not Downloading
      I have been unable to download Flash player, please help.
    4. RecordSet.Move or RecordSet.AbsolutePosition??
      Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to...
    5. downloading a .gif
      Hello, I have a page with lots of thumbnails of photos. I want the user to be able to dload a big version of the photo (also present on the...
  3. #2

    Default Re: Downloading a recordset

    Just at first thought without thinking about the code, I'd probably create
    my recordset, use GetString to delimit the columns by , and the rows by
    vbCrLf, and then either write that to a file with the FSO and redirect to
    it, or stream the file back to the user in an adodb.stream.

    If you get stuck on the code, post back.

    Ray at work

    "Mitchell Nussbaum" <nussbm@dnr.state.wi.us> wrote in message
    news:eGSwYJGWDHA.652@tk2msftngp13.phx.gbl...
    > I have an .asp application that retrieves a table into an ADO recordset
    and
    > retrieves it as an HTML table.
    >
    > I would like to give users the option of downloading the contents of the
    > recordset as a .csv file, but I can't figure out how to do that. I've
    found
    > examples of code that download pre-existing files from the server to the
    > desktop, but I'd prefer not to have the script write a file on the server
    if
    > possible. So I'd like to construct the .csv records line by line, and
    send
    > them to a specified file on the client machine.
    >
    > Is there a way to do this? Or is there some other solution to my problem?
    >
    > Mitch Nussbaum
    > Wisconsin Dept of Natural Resources
    > [email]Mitch.Nussbaum@dnr.state.wi.us[/email]
    >
    >
    >

    Ray at Guest

  4. #3

    Default Re: Downloading a recordset


    "Kris Eiben" <eibenkthisisforspammers@yahoo.com> wrote in message
    news:OFclJPGWDHA.892@TK2MSFTNGP10.phx.gbl...
    > You can pull the whole recordset into a variable using rs.GetString(),
    > formatted as .csv if you want. This example pulls in a recordset as a
    > table, but you can pretty easily convert to a .csv file:
    > [url]http://www.learnasp.com/learn/dbtablegetstring.asp[/url]
    Thanks for this suggestion. I incorporated GetString in my code, and it's
    really neat. Actually, I'd seen documentation for GetString before, but I
    didn't pay much attention, since, at the time, it didn't look like something
    I could use.

    But I do have a problem with GetString for this particular application.
    Some of the values I retrieve have embedded commas, which Excel sees as a
    column delimiter when it reads a .csv file. So some values split into
    multiple cells. When I create a .csv format row-by-row with my own code, I
    enclose string values in quotes to keep values from splitting. Is there a
    way to force GetString to do the same?

    >
    > "Mitchell Nussbaum" <nussbm@dnr.state.wi.us> wrote in message
    > news:eGSwYJGWDHA.652@tk2msftngp13.phx.gbl...
    > > I have an .asp application that retrieves a table into an ADO
    > recordset and
    > > retrieves it as an HTML table.
    > >
    > > I would like to give users the option of downloading the contents of
    > the
    > > recordset as a .csv file, but I can't figure out how to do that. I've
    > found
    > > examples of code that download pre-existing files from the server to
    > the
    > > desktop, but I'd prefer not to have the script write a file on the
    > server if
    > > possible. So I'd like to construct the .csv records line by line, and
    > send
    > > them to a specified file on the client machine.
    > >
    > > Is there a way to do this? Or is there some other solution to my
    > problem?
    >
    >

    Mitchell Nussbaum Guest

  5. #4

    Default Re: Downloading a recordset

    Puzzle 5 Not much different from other solutions by Manohar Kamath
    posted 1/12/99
    [url]http://www.asp101.com/puzzles/puzzle5_s7.asp[/url]

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    [url]http://www.Bullschmidt.com[/url]
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139