ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 10th, 2000, 10:40 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
open text file

<i><b>Originally posted by : Wayne (enyaw24@yahoo.com)</b></i><br />I read a db and display the file names.<br />How do I have the filename hyperlinked to the text file and have the file opened for view.<br /><br />IE..if file name is MyCode.txt<br />How do I hyperlink and open the file in a new window or notepad?<br /><br />Thanks,<br />Wayne<br /><br />db has 3 fields..id, filename,filedisplay<br /><br />

Reply With Quote
  #2  
Old April 11th, 2000, 04:28 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : antony (antovelan@usa.net)</b></i><br />sample code to display text content from db file<br /><br /><br /><%<br />dim con,rs<br />set con=server.CreateObject("adodb.connection")<br />con.Open "dsn=test1"<br />if err.number <> 0 then<br />Response.Write err.description<br />end if<br />set rs=server.CreateObject("ADODB.RECORDSET")<br />rs.Open "select * from file",con<br />if not rs.EOF then<br />'set fs=server.CreateObject("scripting.filesystemobject")<br />'set a=fs.OpenTextFile(rs(1),1)<br />'do while a.atendofstream <> true<br />' b=a.readline<br />' Response.Write b + "<br>"<br />'loop %><br /><br /><a href="javascript:void(0)" onClick="javascript:filedisplay('<%=rs(1)%>')">click here to open the file </a><br /><script language=javascript><br />function filedisplay(filepath)<br />{<br />a=window.open(filepath)<br />}<br /></script><br /><% end if<br /><br />rs.Close<br />con.Close<br /><br />set rs=nothing<br />set con=nothing<br /><br /><br />%><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > open text file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway