Solved

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

Posted on 1998-03-26
2
175 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
[X]
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
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

627 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