472,102 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,102 software developers and data experts.

My ASP program with fso.opentextfile is working on Win2K but not working on Win2K3

Hi all,

My following program code works fine on win 2K server but the same is not working on win2K3 server. It's showing error as page cannot be displayed. After debugging, I found that fso.opentextfile is not working over win2k3. Can anybody pl. explain why it's not working and how to solve it?
help reqd urgently pl.

thx in advance.

Expand|Select|Wrap|Line Numbers
  1. SearchDatabase
  2. <SCRIPT LANGUAGE=JScript>
  3.  
  4. var wsh = new ActiveXObject("WScript.Shell")
  5. wsh.Run("cmd /C dir *.txt > c:\\temp.txt", 0)
  6.  
  7. </Script>
  8.  
  9. <%@ LANGUAGE="VBSCRIPT"%>
  10. <%    
  11.      strM = Getmyfile()
  12.     function Getmyfile()
  13.         Dim intRet,reqdString
  14.          Set fso = createobject("scripting.filesystemobject")
  15.          Set ts = fso.opentextfile("C:\temp.txt")
  16.          reqdString = null
  17.          Do While Not ts.AtEndOfStream
  18.          data = ucase(trim(ts.readline))
  19.          if instr(data,"database") Then
  20.          reqdString = trim(split(data,":")(1))
  21.          Exit Do
  22.          End if
  23.          loop
  24.          ts.close
  25.          Set ts = nothing
  26.          Set fso = nothing
  27.          Getmyfile = reqdString
  28.     End function
  29.     %>
  30.     <HTML>
  31.     <HEAD>
  32.     <TITLE></TITLE>
  33.     </HEAD>
  34.     <BODY>
  35.     <%Response.Write("Your databse is : " & reqdString)%>
  36.     </BODY>
  37.     </HTML>
  38. <HTML>
  39. <HEAD>
  40. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  41. </HEAD>
  42. <BODY>
  43.  
  44. <P>&nbsp;</P>
  45.  
  46. </BODY>
  47. </HTML>
  48.  
  49.  
Sep 10 '07 #1
1 2463
jhardman
3,406 Expert 2GB
I've never heard of this problem before, I have used openTextFile in several different versions of IIS. Perhaps the problem is that permissions aren't set right on one of your servers. Make sure the appropriate server settings are set in IIS and in windows, both for the folder and the file in question.

Jared
Sep 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Kenneth McDonald | last post: by
reply views Thread by Mike Cooper | last post: by
reply views Thread by Mark Brown | last post: by
6 posts views Thread by ahmee | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.