Hi everyone,
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 )
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
%>
[code]
Another member suggested that I google "scripting.filesystemobject" which I have and am not too sure about. Would anyone be able to give me an example using the above code of how I use this object?
Thanks
Samantha