SQL db and Comma Delimited Export

Results 1 to 3 of 3

Thread: SQL db and Comma Delimited Export

  1. #1
    S. Finn Guest

    Default SQL db and Comma Delimited Export

    &nbsp;<BR>Hello there --<BR><BR>I am in charge of making a registration form on our website which will save the information gathered to a SQL database. This part is not a problem for me.<BR><BR>The problem is, the marketing department wants to review the data regularly, and has asked for output to be in "excel (.xls) or tab/comma delimited format". I don&#039t even know what comma delimited format is! And is it the same thing as .xls format? <BR><BR>Someone recommended I export the whole db in Excel format through SQL Server&#039s Enterprise Manager, but I am hoping to be able to do it programmatically through ASP at the touch of a button on the website.<BR><BR>Any help is appreciated,<BR><BR>S. Finn

  2. #2
    SPG Guest

    Default RE: SQL db and Comma Delimited Export

    Tab delimited would be your best bet in my guess. What it means is that you&#039ve got<BR><BR>info1,1 (vbTab) info2,1 (vbTab) info3,1 (vbCrLf)<BR>info1,2 (vbTab) info2,1 ...<BR><BR>This is easy to create! Just grab your recordset (there&#039s lots of articles on that bit) and<BR><BR>aRS = objRS.getRows &#039 Convert to array for ease & speed<BR>for i = 0 to uBound(aRS, 2) &#039 For each record<BR> for h = 0 to uBound(aRS, 1) &#039 For each field<BR> strOutput = strOutput & aRS(h, i) & vbTab<BR> next<BR> strOutput = strOutput & vbCrLf<BR>next<BR><BR>And that&#039s all there is to it. It&#039ll be very slow (looped string building gets worse every time) and there will be a spare column (but they shouldn&#039t notice) and you still have to get it out of there on your own (easy!), but that&#039s generally how it&#039s done.

  3. #3
    Garth Guest

    Default RE: SQL db and Comma Delimited Export

    I would like to suggest that you try the following:<BR><BR>1. Create a DTS Package that exports the data to the desired format.<BR>2. Call the DTS Package from your ASP.<BR><BR>I have used this approach in reverse (getting data into SQL Server) and it works very well.<BR><BR>Garth<BR>www.SQLBook.com

Posting Permissions

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