<html>
<head>
<title>asp read csv</title>
<style>
caption{padding:5px;margin:8px auto;margin-left:18px;}
table{border-top:2px solid #0180CF; margin:0 auto;font-size:12px;width:99%;}
table td{min-width:66px;border-bottom:1px solid #a2c6d3;padding:5px 0px;word-wrap:break-word;word-break:break-all;}
table tr:nth-child(even){background: #FCFCFC;}
</style>
</head>
<body>
<%
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
"Dbq=" & Server.MapPath("/csv/") & ";Extensions=asc,csv,tab,txt;Persist Security Info=False"
strSQL = "SELECT * FROM test.csv"
Set objRec = Conn.Execute(strSQL)
%>
<table cellspacing='0'>
<%
If Not objRec.EOF Then
objRec.MoveFirst
lies = objRec.fields.count
response.write "<tr class='tt'>"&vbcrlf
for i = 0 to lies - 1
lieti = objRec.fields.item(i).name 'objRec.Fields(0).name
response.write "<td><nobr>" & lieti & "</nobr></td>"&vbcrlf
next
response.write "</tr>"&vbcrlf
While Not objRec.EOF
response.write "<tr>"&vbcrlf
for i = 0 to lies - 1
lieti = objRec.fields.item(i).value 'objRec.Fields(0).Value
response.write "<td>" & lieti & "</td>"&vbcrlf
next
response.write "</tr>"&vbcrlf
objRec.MoveNext
Wend
End IF
%>
<%
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
</table>
</body>
</html>