Rob,
I spent today working on importing a csv/xls group of files and this may
help you:
<%
' create and open the connection to the database
Set cn = Server.CreateObject("ADODB.Connection")
' create and open the recordset
cn.open "ODBC;DBQ=c:\items.xls;Driver={Microsoft Excel Driver (*.xls)}"
set rs=server.createobject("ADODB.recordset")
rs.activeconnection=cn
rs.source="select * from ITEMS"
'NOTE: you will want to create a named range of all data cells in your
CSV file
'by highlighting them all, and typing a name in the cell name box in
upper left
'of excel sheet...then select from it as you would in sql...
rs.open
%>
<TABLE Border=1 CellPadding=3>
<TR>
<% For col = 0 To RS.Fields.Count-2 %>
<TH><% = RS.Fields(col).name %></TH>
<% Next %>
</TR>
<% Do While Not RS.eof %>
<TR>
<% For col = 0 To RS.Fields.Count-2 %>
<TD><% = RS.Fields(col).value %></TD>
//here you can do whatever you need, as in write out to database...I am
writing to arrays then building a new CSV file
<% Next %>
</TR>
<% RS.MoveNext %>
<% Loop %>
</TABLE>
<%
rs.close
cn.close
set rs = nothing
set cn = nothing
%>
Hope this helps some...
Mike
"rob" <rl*****@supanet.com> wrote in message
news:c0**********@hercules.btinternet.com...
Hi all,
I've got a csv file which I will need to import into an access db via asp.
The csv file will be imported every day of each month so there will be
duplicates which will not need to be imported. Any sample scripts
pointing me in the right way would be great.
Many thanks,
Rob