Create Text or CSVFile

  1. Newline characters: chr(13) & chr(10)
  2. position = page_size * (page – 1) + 1
  3. Tab character: chr(9)
  4. File handler:
    set fso = createObject("Scripting.FileSystemObject")

    path = "../list/White.csv"
    set file = fso.createTextFile(server.MapPath(path), true, true)
  5. total = rs.recordCount
  6. How to get page count:
    rs.pageSize = 100
    page_count = rs.pageCount 
  7. To improve performance, write contents every specific number of records:
    if i mod 500 = 0 then
    file.writeLine temp & field_line
    temp = ""
    else
    temp = temp & field_line & new_line
    end ifrs.moveNext

    if rs.eof then
    file.writeLine temp
    exit for
    end if

  8. To avoid numbers that start with "0" will be removed, need to add chr(127) before value
     

​Sample:

 

4 thoughts on “Create Text or CSVFile

  1. nha dang ky chinh thuc ten mien viet nam

    I’m extremely impressed along with your writing abilities and also with the structure for your blog. Is that this a paid topic or did you modify it yourself? Either way stay up the nice quality writing, it’s rare to see a great weblog like this one nowadays..

  2. sunucu kurulumu

    Amazing things here. I am very happy to see your post. Thank you so much and I’m having a look ahead to contact you. Will you kindly drop me a mail?

  3. character counter

    Generally I don’t learn post on blogs, but I wish to say that this write-up very forced me to check out and do so! Your writing style has been amazed me. Thanks, very nice article.

  4. Discounts Here

    You actually make it seem so easy together with your
    presentation but I to find this topic to be really one thing that I
    feel I would by no means understand. It kind of feels too complicated and
    extremely large for me. I’m looking forward in your subsequent post, I will try to get the cling of it!

Comments are closed.