ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 12th, 2003, 11:31 AM
davidDuke's Avatar
davidDuke davidDuke is offline
<? echo "Hello World!"; ?>
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: 30pixles by 30pixels
Posts: 125 davidDuke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 17 sec
Reputation Power: 5
Send a message via AIM to davidDuke Send a message via MSN to davidDuke
Question FileSystemObject to Read Text Files

Can I use FileSystemObjects to Read Text Files on my server rather than just on my local drive?

D#

Reply With Quote
  #2  
Old November 12th, 2003, 11:41 AM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,829 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 23 m 12 sec
Reputation Power: 765
Yes, if the web server user account has proper permissions to read the file.

Reply With Quote
  #3  
Old November 12th, 2003, 11:50 AM
davidDuke's Avatar
davidDuke davidDuke is offline
<? echo "Hello World!"; ?>
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: 30pixles by 30pixels
Posts: 125 davidDuke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 17 sec
Reputation Power: 5
Send a message via AIM to davidDuke Send a message via MSN to davidDuke
Unhappy

I used a piece of code the following code off 4guys:
Code:
<%
' Read from test file
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objTextStream

const strFileName = "/oak/test.txt"
const fsoForReading = 1

If objFSO.FileExists("/oak/test.txt") then
	'The file exists, so open it and output its contents
	Set objTextStream = objFSO.OpenTextFile(strFileName, fsoForReading)
	Response.Write "" & objTextStream.ReadAll & ""
	objTextStream.Close
	Set objTextStream = Nothing
Else
	'The file did not exist
	Response.Write strFileName & " was not found."
End If

'Clean up
Set objFSO = Nothing

%>
But it gave this error message:
Quote:
Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/oak/test.asp, line 13

Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
Can anyone help?

- D#

Reply With Quote
  #4  
Old November 12th, 2003, 12:26 PM
davidDuke's Avatar
davidDuke davidDuke is offline
<? echo "Hello World!"; ?>
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: 30pixles by 30pixels
Posts: 125 davidDuke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 17 sec
Reputation Power: 5
Send a message via AIM to davidDuke Send a message via MSN to davidDuke
I tried this code on a brinkster accont and gave me the same error!

BTW, i have no idea of the FSO is enabled, as i'm using a shared server through a hostings company!

Help NEEDED!!

- D#

Reply With Quote
  #5  
Old November 12th, 2003, 01:30 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,829 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 23 m 12 sec
Reputation Power: 765
It sounds like the FSO is removed on your web server. This is not uncommon with windows hosts, some ISP's don't take the time to properly configure permissions and the FSO can be a security risk.

Check with your host.

Reply With Quote
  #6  
Old November 12th, 2003, 01:36 PM
davidDuke's Avatar
davidDuke davidDuke is offline
<? echo "Hello World!"; ?>
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: 30pixles by 30pixels
Posts: 125 davidDuke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 17 sec
Reputation Power: 5
Send a message via AIM to davidDuke Send a message via MSN to davidDuke
Lightbulb

Is there any other way of doing what i need to do without FSO?

- D#

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > FileSystemObject to Read Text Files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway