Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2005, 09:35 AM
Authorized User
 
Join Date: Feb 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connectiong to .csv file

I'm trying to create an connection to a file with an .csv extension. Using the normal method to connect to a database is not working could someone please show me how to connect and open .csv files.

--Connection.asp--

<%
  Dim objConn
  Set objConn = Server.CreateObject("ADODB.connection")
  objConn.open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
               "Data Source=c:\Inetpub\wwwroot\compute3\Equity_Pack_Bas ic_2005-03-30-1030.csv"
%>


--Home.asp--

 <%
 Dim rsComList
 Set rsComList = Server.CreateObject("ADODB.Recordset") r
 rsComList.Filter = "IN_ISEQ = Y"
 rsComList.Open objConn, adOpenForwardOnly, asLockOptimistic,
 adCmdTable

 do while NOT rsComList.EOF
   Response.write _
     "<tr class=""evenRow"">" & _
       "<td>" & rsComList("ISSUER_NAME") & "</td>" & _
       "<td>" & rsComList("OPEN_PRICE") & "</td>" & _
       "<td>" & rsComList("OFFICIAL_CLOSING_PRICE") & "</td>" & _
       "<td>" & rsComList("DAILY_HIGH") & "</td>" & _
       "<td>" & rsComList("DAILY_LOW") & "</td>" & _
     "</tr>"
   rsComList.MoveNext
 Loop
%>



 
Old March 31st, 2005, 09:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Try connecting through Excel, as shown in this example: http://www.dotnetjohn.com/articles.aspx?articleid=54

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Export To .csv File paul31Hampshire Access VBA 18 June 26th, 2006 11:30 AM
Sql a .csv file langer123 Classic ASP Basics 2 April 18th, 2005 08:55 AM
Reading a .csv file Dave Brown Beginning PHP 1 March 1st, 2005 10:57 AM
Reading a csv file agongar Beginning VB 6 2 February 9th, 2005 12:39 PM
read csv file ccc_storage Classic ASP Professional 2 August 21st, 2004 04:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.