Database
  Home arrow Database arrow Page 4 - Reading and Writing to Files on the Intran...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Reading and Writing to Files on the Intranet
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2006-10-10

    Table of Contents:
  • Reading and Writing to Files on the Intranet
  • Opening the Stream Object
  • Can you read text in another language?
  • Writing to a file with an HTM extension
  • Reading and writing binary files

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Reading and Writing to Files on the Intranet - Writing to a file with an HTM extension


    (Page 4 of 5 )

    The listing in the next paragraph writes to the Test.htm file on the intranet site in the folder.

    Set rec = New ADODB.Record
    rec.Open "DevHome/ASPFree/Test.htm", _
    "URL=http://hodentek/", adModeReadWrite, _
    adCreateOverwrite + adCreateNonCollection
    Set strm = New ADODB.stream
    strm.Type = adTypeText
    strm.Charset = "ASCII"
    strm.Open rec, adModeReadWrite, adOpenStreamFromRecord
    strm.WriteText "<html><head><title>QuoteFromPrince</title></head><body>", 
    adWriteLine strm.WriteText "<center><p><font color='red'>Quote from Prince Niccolo
    Machiavelli</font></p> </center> " strm.WriteText "<blockquote><font color='blue'>It must be remembered that
    there is nothing more difficult of success, nor more dangerous to plan than the", adWriteLine strm.WriteText "creation of a new System --<b>The Prince</b></font>
    </blockquote>", adWriteLine strm.WriteText "</body></html>" strm.Flush strm.Close rec.Close End Sub

    The Test.htm file when browsed shows the following display.

     

    More Database Articles
    More By Jayaram Krishnaswamy


       · This is a powerful procedure, but use it with caution. Any procedure that gives...
     

    DATABASE ARTICLES

    - Building Applications with Anonymous Types
    - A Closer Look at Anonymous Types
    - Programming with Anonymous Types
    - Converting Your Excel Worksheet into a Worki...
    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek