473,378 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

FileSystemObject Scripting don't work

Hi,

I am having ASP with the following code to access the file with windows
scripting host. The page run on local server IIS 5.1 on Win XP Pro SP2. The
IE never show me any error with this, but will keep access the page for very
long. This code is running fine on other system.

strFilePath = Server.MapPath("\db\counter.txt")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.OpenTextFile(strFilePath, ForReading)
iCounterNumber = Cdbl(objCounterFile.ReadLine) + 1
objCounterFile.Close

This code will work fine if i change 3rd line to
[objFSO.OpenTextFile(strFilePath,1) ].

Questions:
1. Why objFSO.OpenTextFile(strFilePath, ForReading) can't work on my system
but can run on the others system.
2. Why IE never show me error message but keep accessing the page for very
long with the above code?

thanks & regards,

Edward
Dec 1 '05 #1
5 1753
Hi All,
Get it work once i disable the script blockin in my Antivirus setting....

Thanks
Edward

"Edward Low" <wc****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi,

I am having ASP with the following code to access the file with windows
scripting host. The page run on local server IIS 5.1 on Win XP Pro SP2.
The IE never show me any error with this, but will keep access the page
for very long. This code is running fine on other system.

strFilePath = Server.MapPath("\db\counter.txt")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.OpenTextFile(strFilePath, ForReading)
iCounterNumber = Cdbl(objCounterFile.ReadLine) + 1
objCounterFile.Close

This code will work fine if i change 3rd line to
[objFSO.OpenTextFile(strFilePath,1) ].

Questions:
1. Why objFSO.OpenTextFile(strFilePath, ForReading) can't work on my
system but can run on the others system.
2. Why IE never show me error message but keep accessing the page for very
long with the above code?

thanks & regards,

Edward

Dec 1 '05 #2
Edward Low wrote:
Hi All,
Get it work once i disable the script blockin in my Antivirus
setting....

Thanks for letting us know, but if someone had already wasted his time
replying to this question here without realizing you had already received an
answer in .asp.db (what does this question have to do with db's anyways? why
post it there at all?), he would not have been a happy camper. What are the
chances that he would respond to any further questions from you?

Please don't multipost. The best practice is to pick a single newgroup that
you feel is most relevant to your question and post it there. If you've
guessed wrong, someone will let you know (usually politely). If you feel you
must get input from members of more than one group, crosspost instead of
multiposting by putting the names of each group into the To field of a
single newsgroup post. That way responses will be seen by all regardless of
which newsgroup the responses originated in. Again, it is best to keep the
number of groups in the crosspost small.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Dec 1 '05 #3
Edward Low wrote:
Hi All,
Get it work once i disable the script blockin in my Antivirus
setting....


Oh, and please fix your clock.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Dec 1 '05 #4
Boy, you sure are a picky fellow
Cut these people some slack.
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:eU*************@TK2MSFTNGP15.phx.gbl...
Edward Low wrote:
Hi All,
Get it work once i disable the script blockin in my Antivirus
setting....


Oh, and please fix your clock.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Dec 3 '05 #5
I'm sorry you think it's picky. The view I normally use sorts the messages
by posting date. I almost replied to the wrong message because the OP's
clock was set incorrectly. I thought he might appreciate knowing that his
clock was wrong. My only fault (IMO) was saying it too curtly which I now
regret.

Larry Randolf wrote:
Boy, you sure are a picky fellow
Cut these people some slack.
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:eU*************@TK2MSFTNGP15.phx.gbl...
Edward Low wrote:
Hi All,
Get it work once i disable the script blockin in my Antivirus
setting....


Oh, and please fix your clock.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so
I don't check it very often. If you must reply off-line, then remove
the "NO SPAM"


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Dec 3 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Dewbert | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Hello, I have trouble passing a folder object (from a FileSystemObject) to a sub procedure. Consider the following code: ...
0
by: Giorgio Cervati | last post by:
Hi everybody, found strange behavior in Scripting.FileSystemObject; only FileExists() method seems to work fine. All other methods cause browser to indefinitely wait for something that never come....
3
by: bt | last post by:
I am just beginning with asp and have gotten an error that I need some help with. I posted a pair of files to an online ASP host server. The files are in the same directory; one is readfile.asp...
9
by: MDW | last post by:
I'm not sure if this is a coding problem or an IIS settings problem. I've enabled IIS on my local machine (Windows XP SP2) so I can do some ASP development prior to rolling out my Web page to a...
9
by: kermit | last post by:
I keep seeing that you can use the FileSystemObject in either VB script, or Javascript on an aspx page. I added a refrence to the scrrun.dll I added importing namespaces for 'System.Object',...
4
by: Tony | last post by:
I am trying (unsuccessfully) to open a file using fso.OpenTextFile. I have given Full Trust to the assembly in Code Groups and Assembly Trust. I have added IUSR and IWAM as users. I have checked...
7
by: google | last post by:
I am trying to use the following ASP code to examine the file names in a folder: Dim fso, f, fl, s, fs Set fso = CreateObject("Scripting.FileSystemObject") Set f =...
1
by: G Gerard | last post by:
Hello I am using the FileSystemObject to copy files on a computer Dim MyObject as Object
3
by: brigitte | last post by:
The original problem: I need a procedure to import a csv file created by a third party application into an Access database. This file contains fields which may include commas, and when they do,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.