Wrox Programmer Forums
|
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 November 26th, 2005, 05:54 AM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default using Scripting.FileSystemObject under IIS 5.1

Dear every body!
I have a problem of using scripting.FileSystemObject under IIS5.1 in windows XP Pro. if any body know, please help me!!!
My problem:
Such a very simple code like this:

Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fso.CreateTextFile("c:\testfile.txt", True)
a.WriteLine("This is a test.")
a.Close

When I using that code for VB6 Application, it run OK.
But when I put that code in to ASP file, it can not run.
I'm sure My IIS is runing and I can connect to a mdb file.
Please help me ASAP

many thanks

Khin Lau

 
Old November 26th, 2005, 09:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

this will most likely be permissions problem trying to create file in c:
try
Set a = fso.CreateTextFile(Server.MapPath("testfile.txt"), True)
that will create file in your web root. If that works then it will prove FileSystemObject is OK and you just need to sort out permissions to write to other folders.





Similar Threads
Thread Thread Starter Forum Replies Last Post
FileSystemObject not available mega Classic ASP Professional 1 June 19th, 2006 10:25 AM
Using the FileSystemObject malhyp Dreamweaver (all versions) 1 October 2nd, 2005 07:00 AM
Scripting.FileSystemObject mcinar Classic ASP Basics 2 April 4th, 2005 07:14 AM
I need help with FileSystemObject ... PLEASE xanderxvr Classic ASP Professional 0 January 31st, 2005 02:56 AM
FileSystemObject dikkjo Classic ASP Components 2 October 15th, 2003 06:50 AM





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