Reading from Excel

Results 1 to 3 of 3

Thread: Reading from Excel

  1. #1
    Dheeraj Patri Guest

    Default Reading from Excel

    How do you read from an excel file within an ASP, while not using ADO. The problem with using ADO, is that a named range must be set. I want to read an excel file on the fly and get all the values from it, regardless of whether they formatted by using a named range<BR><BR>Perhaps, there is a COM component to do this?

  2. #2
    RP Guest

    Default RE: Reading from Excel

    You could use WDDX or SOAP to do this. I have never implemented this in SOAP but did it in WDDX. Check out the site and the example given in the SDK. There are three dlls that the user needs to have on the machine to use wddx to upload/download data to office applications. WDDX is an open standard and the dlls are freely distributable.<BR><BR>HTH<BR><BR>RP

  3. #3
    Join Date
    Dec 1969

    Default RE: Reading from Excel

    Believe it or not, When I need to read an excel spreadsheet, I simply standard SQL statements to read the data in. It is still and ADODB connection - but uses Excel Drivers. I have not had to name any ranges at all using this method:<BR><BR>&#039 Create and open our connection<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.Open "DRIVER=Microsoft Excel Driver (*.xls);" & "DBQ=" & Server.MapPath("Spreadsheet.xls")<BR>set rs = server.createobject("adodb.recordset")<BR><BR>sql = "SELECT [CumulativeActuals$]![ChartNo],[CumulativeActuals$]![Last]"<BR><BR>sql = sql & " FROM [CumulativeActuals$] WHERE ([CumulativeActuals$]![Seq] = 1)"<BR><BR>Remember the Row of the spreadsheet needs to be the column titles, too. But otherwise, the only drawback to this method is It seems like I must use the ordinal references when using the fields names - <BR>rs.fields(0) would mean I want the the first field mentioned in the "select statement". I am unable to refer to it as:<BR>rs.fields("ChartNo")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts