WelcomeServicesPortfolioKnowledge BaseContact Us
27 Seconds, Inc.


Knowledge base View Article

need hosting?

Need hosting? We use and love our host - CrystalTech.com!
Need hosting? We use and love our host - CrystalTech.com!

Text Disguise - CAPTCHA-image/Human Interactive Proof web services

National Holiday Dates and Bank Holiday Dates - web site that provides the dates of national and bank holidays for the United States, United Kingdom, Ireland and Scotland

Holiday Web Service - web services for programmers to provide the dates of national and bank holidays in their applications for the United States, United Kingdom, Ireland and Scotland

Our Family Heart - web site to help families communicate no matter where they are

What?! You haven't heard about the greatest remote controlled flyer to come out in years?! Checkout the FlyTech DragonFly now!

Use ADODB.Stream to read text files.

Summary: Instead of using the FileSystemObject, you can use the ADODB.Stream object to read Text files.
 
Keywords: ADODB
ADODB.STREAM
ASCII
FILESYSTEMOBJECT
FSO
STREAM
TEXT
TEXTSTREAM
Applicable Software: Active Server Pages (ASP)
ADO
 
Body:

Some hosting companies do not allow you to use the FileSystemObject for the sake of security. (Note: even though it is a poppy-cock reason, because security can be locked down and you can still safely use the FileSystemObject in a shared hosting environment.)

I have found that I you can use the ADODB.Stream object to read text files.

Dim s
Dim oStream

Set oStream = Server.CreateObject("ADODB.Stream")
	oStream.Open
	oStream.Type = 2	' Set type to text
	oStream.CharSet = "ascii"
	oStream.LoadFromFile("temp.txt")
	s = oStream.ReadText
	oStream.Close
Set oStream = Nothing

Response.Write s

 
Author: Douglas L. Setzer, II, http://www.27seconds.com
Posted On: 12/30/2003 6:29:08 AM

Rate this article: Average: 9.2
n/a12345678910
Comments?

Article Search   |   All Articles

 

 
©2002 27 Seconds, Inc. All Rights Reserved.