Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm trying to open file for viewing when button clicked!

Status
Not open for further replies.

mijulie

Programmer
Jun 21, 2001
36
0
0
IE
This is my code, I don't get any errors but nothing opens!
Does anyone see the problem?
Thank you in advance if you can help,
Mijulie

<HTML>
<HEAD>
<H1>SIT_TEST_CIT:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Build Validation</H1>
<SCRIPT LANGUAGE=&quot;VBSCRIPT&quot;>
sub d1_onclick
dim filesys, filetxt
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set filetxt = filesys.OpenTextFile(&quot;c:\buildv.txt&quot;, 1, true)

end sub
</SCRIPT>
</HEAD>
<BODY BGCOLOR=&quot;#FFFFFF&quot;>


<INPUT type=&quot;button&quot; value=&quot; Get &quot; id=d1 name=d1 >


</BODY>
</HTML>
 
mujulie,

Once you open the file, you have access to it's records, so you have to read it first, then write it to the web page.
Place this after: &quot;Set filetxt = filesys.OpenTextFile(&quot;c:\buildv.txt&quot;, 1, true)&quot;


Do While filetext.AtEndOfStream = FALSE
Txt = filetext.ReadLine
Response.write txt
Loop


Fengshui1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top