read text from textfile

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vasanthspiky28
    New Member
    • Jan 2010
    • 4

    read text from textfile

    the below code displays the details of tittles from a table papers wat i nee is f i click the displayed tittle a textfile of that tittle should get opened help me..
    Code:
    <%
    Dim con,rs,sl
    
    	set con=server.CreateObject("ADODB.Connection")
    	set rs=server.CreateObject("ADODB.Recordset")
    	con.open Application("db")	
    sl = "SELECT * FROM papers "
    rs.Open sl,con
    Response.Write "<table width='100%'>"
    Do While Not rs.EOF
    response.Write "<tr><td><img src=""images\free_bullet.gif"" width=""10"" height=""10""></td>"
    Response.Write "<td><a class=a1 href=" & rs("Upload1") & ">" & rs("Tittle1") & " <br></td></tr>"
    rs.MoveNext
    Loop
    Response.Write "</table>"
    rs.Close
    con.Close%>
    Last edited by jhardman; Jan 6 '10, 10:34 PM. Reason: added code tags
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    is the field "upload1" the virtual path to the text file? If so, then this should work:
    Code:
    <%
    Dim con,rs,sl
     
        set con=server.CreateObject("ADODB.Connection")
        set rs=server.CreateObject("ADODB.Recordset")
        con.open Application("db")    
    sl = "SELECT * FROM papers "
    rs.Open sl,con %>
    <table width="100%">
    <%
    Do While Not rs.EOF %>
       <tr><td><img src="images\free_bullet.gif" width="10" height="10"></td>
       <td><a class="a1" href="<%=rs("Upload1")%>"><%=rs("Tittle1")%>
       <br></td></tr>
       <%
       rs.MoveNext
    Loop 
    rs.close 
    con.Close %>
    </table>
    Let me know if this helps.

    Jared

    Comment

    • vasanthspiky28
      New Member
      • Jan 2010
      • 4

      #3
      thanks jared.......... ............... ............... ..... ............... ...........

      thaks jared it worked..

      Comment

      Working...