global.asa and Microsoft.FileSystemObject

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tiredoldcoder

    global.asa and Microsoft.FileSystemObject

    Currently I am trying to convert a rather large ASP web app (1700+ files) to
    ..NET, but I'm having trouble using the FSO in my global.asa file. The
    following code sends IIS into never-never land when it gets to Set oTF = ...
    :

    Function ReadFile(sFileS pec)

    Dim oFS ' Scripting FileSystemObjec t
    Dim oTF ' Textfile Object

    Set oFS = Server.CreateOb ject("Scripting .FileSystemObje ct")
    If oFS.FileExists( sFileSpec) Then
    Set oTF = oFS.OpenTextFil e(sFileSpec, 1, True)
    ReadFile = oTF.ReadAll()
    oTF.Close()
    Set oTF = Nothing
    Else
    Application("Gl obal_Abort") = Application("Gl obal_Abort") _
    & sFileSpec & " does not exist"
    ReadFile = ""
    End If

    Set oFS = Nothing

    End Function

    I have to usually run iisreset to get it straight again. My current
    environment is Win XP Pro SP2 and VS 2005 Beta 1. Due to current operational
    needs I have to keep my ASP & ASP.NET running together during the transition.
    Any help would be greatly appreciated.

    --
    Wm. F. Wheeler
    CDO Tech Inc
  • kaqeel

    #2
    Re: global.asa and Microsoft.FileS ystemObject

    I just ran into the same problem. My application is in ASP. In
    debugging, I saw the CreateObject("S cripting.FileSy stemObject") returns
    successfully but the call the fso.OpenTextFil e never returns.
    I am running WinXP Pro SP2 and have VS 2003 installed

    Regards,
    Kashif

    Comment

    Working...