Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2008

    Exclamation Unanswered: reading data from excel

    Any 1 here konw how to retrieve the data from excel to and then display it out on internet browser using ASP ?any know konw how to set the connection strings excel with ASP ?

  2. #2
    Join Date
    Sep 2008
    Any 1 whom have done excel with asp help me pls..
    i currently have these codes
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">

    <%@ Language=VBScript %>
    ' Set Connection Params
    Set oConn = Server.CreateObject("ADODB.connection")
    oConn.Open "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;" &_
    "DBQ=C:\Inetpub\wwwroot\InfoWeb\14Apr08_NUS_hr_Dat a.xls;" &_
    "DefaultDir = C:\Inetpub\wwwroot\InfoWeb\"

    Set RS=Server.CreateObject("ADODB.recordset")

    ' Write the SQL Query "SELECT * FROM my_range", oConn

    do until RS.EOF
    Response.Write ( RS("Item No") & " -- " & RS("Item Description") & "<br>")

    'Close the recordset/connection

    Set RS = Nothing

    <title>Pressure Chart</title>

    <applet codebase="new" code="linegraph.class" height=220 width=360>
    <param name="title" value="Sales">
    <param name="NumberOfVals" value="<%=sqlQuery.RecordCount%>">
    <param name="NumberOfLabs" value="<%=sqlQuery.RecordCount%>">
    <PARAM NAME=ymax VALUE=<%=(Fix(sqlQuery("M")/10000)+1)*10000%>>
    <PARAM NAME=ymin VALUE=0>
    <PARAM NAME=mode VALUE=0>
    <PARAM NAME=border VALUE="20"> <PARAM NAME=Grid VALUE="true">
    <PARAM NAME=LineColor_R_L1 VALUE=53>
    <PARAM NAME=LineColor_G_L1 VALUE=153>
    <PARAM NAME=LineColor_B_L1 VALUE=51>
    i = 1
    while (not sqlQuery.EOF) %>
    <param name="VAL<%=i%>_L1" value="<%=sqlQuery("SalesTotal")%>">
    <param name="LAB<%=i%>" value="<%=MonthName(Month(sqlQuery("Date")))%>">
    i = i + 1
    wend %>


    So how do i set my range which i underline? there are error in the codes could you point out to me ?

    this is the error:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

    [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'my_range'. Make sure the object exists and that you spell its name and the path name correctly.

    /Infoweb/pressure.asp, line 15

Posting Permissions

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