Hi everyone,
Apologies if this is not the correct forum to post this in...
I am trying to display information from a csv file on a website. This is what I have so far...(I know this is wrong, but I've only extracted info from Access databases before using SQL )
Could anyone please tell me what I am doing wrong?
Thanks
Samantha
Apologies if this is not the correct forum to post this in...
I am trying to display information from a csv file on a website. This is what I have so far...(I know this is wrong, but I've only extracted info from Access databases before using SQL )
Code:
<%
set conn=Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq="& strPath &";Extensions=asc,csv,tab,txt;Persist Security Info=False"
strFile = "HD_Closed.csv"
strPath = "\\server\c$\inetpub\[URL unfurl="true"]wwwroot\Stats\Stats\db2"[/URL]
'set rs = Server.CreateObject("ADODB.recordset")
rs.Open "select HD_Name, Total FROM "& strFile &""
%>
<table align="center" border="1" size="100%">
<tr>
<td class="hnav">
<b>Name</b>
</td>
<td class="hnav">
<b>Total</b>
</tr>
<%for each x in rs.Fields
next%>
</tr>
<%do until rs.EOF%>
<tr>
<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%></td>
<%next
rs.MoveNext%>
</tr>
<%loop
rs.close
conn.close
%>
Could anyone please tell me what I am doing wrong?
Thanks
Samantha