Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to append text to a file in asp without overwriting it?

Posted on 1998-03-26
2
163 Views
Last Modified: 2013-12-25
I want to append text to a file within asp. I am trying to open the textfile for appending but I can't. I can only open it for writing which obviously rewrites the whole file erasing its previous contents. I have tried the "ForAppending" parameter (value 3) but it doesn't work.

Any ideas on the subject? Any reasons why it doesn't work?
Any workaround you know?


I'd really appreciate your help.



Thank you very much.
0
Comment
Question by:manuelf
2 Comments
 

Accepted Solution

by:
juliomb earned 20 total points
ID: 1832217
Your problem it's the mode of openfile, "ForAppending it's value '8' not '3'

Please, test this code.

-----------------------------------

' Create Object
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")

' Open Scream por Append

  Set OutStream= FileObject.OpenTextFile ("file_name", 8)

  OutputString = "your text to append"

  OutStream.WriteLine OutputString

'Clear
  Set OutStream = Nothing
-----------------------------------
0
 

Author Comment

by:manuelf
ID: 1832218
This morning I had already found the right value (8) but thanks a lot anyway julio.
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question