Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSV FILE CANT OPEN

Status
Not open for further replies.

gsc123

Programmer
Jan 24, 2008
197
Hi

What is wrong with this please

<%
Dim conn, rs, arr
Dim csvfile


Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.RecordSet")

conn.Open = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=" & Server.MapPath("ESCORTLIST.csv")
csvfile = "ESCORTLIST"


Dim sql, f
sql = "SELECT * FROM "&csvfile
Set rs = conn.Execute("&sql&")
'Response.Write conn.ConnectionString

On Error resume next

For f = 0 To rs.Fields.Count-1
%><tr><TH><% = rs.Fields(f).name %></TH><%
%><TD><% = rs.Fields(f).value %></TD>
<% Next
Set rs = Nothing
conn.Close
Set conn = Nothing

%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top