Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2005, 08:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , NY, USA.
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default Scripting.FileSystemObject

Hi All,

I have a virtual directory in IIS called "Billing" and it points to
"D:\Billing" folder. It is outside of IIS drive.

If I try to open a PFD file in this folder, I can do it.
But I try to access a "Text" file to read it by using
"Scripting.FileSystemObject", it doesn't find the "Path" and gives an error. Here is my code;

<%
dim objFSO, objFileText, strPath, strLineText, strSourceFile

strSourceFile = "File1.txt"
strPath = "/Billing/" & strSourceFile

set objFSO = server.CreateObject("Scripting.FileSystemObject")
set objFileText = objFSO.OpenTextFile(strPath, 1, false)

' read one line at a time
do while not objFileText.AtEndOfStream
    strLineText = objFileText.readline

    response.Write strLineText
loop

set objFSO = nothing
set objFileText = nothing
%>

Thanks for your help,
:)

MCinar

Love all the creatures because of the creator.
__________________
MCinar

Love all the creatures because of the creator.
 
Old April 3rd, 2005, 09:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can you post here the exact error that you see?

_________________________
- Vijay G
Strive for Perfection
 
Old April 4th, 2005, 07:14 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , NY, USA.
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Happygv,

Here is the exact error;
"
Error Type:
Microsoft VBScript runtime (0x800A004C)
Path not found
/lettertemplates/mc_filescript_2.asp, line 8
"

Thanks for your help,


MCinar

Love all the creatures because of the creator.




Similar Threads
Thread Thread Starter Forum Replies Last Post
FileSystemObject not available mega Classic ASP Professional 1 June 19th, 2006 10:25 AM
Need Help about FileSystemObject vbpratap VB.NET 0 March 3rd, 2006 06:40 AM
using Scripting.FileSystemObject under IIS 5.1 khinlau Classic ASP Basics 1 November 26th, 2005 09:18 AM
Using the FileSystemObject malhyp Dreamweaver (all versions) 1 October 2nd, 2005 07:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.