I'm having issue retaining the number/text format when I export the data out in .csv format.
In my database table, I have a column with this design: ClaimantNRIC varchar(20)
In my classic asp page, I'm using these code to read the data and export it to excel:
do while not rs.EOF
ROCNo = rs("ROCNo")
ClaimantNRIC = rs("ClaimantNRIC")
SurgAnaesPayable10 = rs("SurgAnaesPayable10")
Detail ="""" & ROCNo & """,""" & ClaimantNRIC & """,""" & SurgAnaesPayable10 & """"
Response.Write(Detail & vbcrlf)
rs.MoveNext()
loop
MyTF.Close
Response.AddHeader "content-disposition", "attachment;filename=ABC.csv"
Response.Charset = ""
Response.CacheControl=0
Response.ContentType = "application/vnd.ms-excel"
Response.End
Expected result:
Currently getting (wrong result):
When open using notepad, I'm still getting the wrong result. So, how can I fix this?