Reusing FileSystemObject Object

If I create a FileSystemObject Object is it appropriate to reuse it to perform operations on different files/folders? Or should I create a new FileSystemObject Object for each file and folder?

View Replies


ADVERTISEMENT

Object Required Error With FileSystemObject

When I include this script:

Set fso = CreateObject("Scripting.FileSystemObject")
f = fso.GetFolder(mypath & "www/qualcomm/bulletin/pdfs/")
response.write(f)
set fc = f.Files <-- line 113

I get the following error:

Microsoft VBScript runtime error '800a01a8'
Object required: 'D:InetpubCustomers'
/qualcomm/_admin/bulletins.asp, line 113

But in a different script I have the following:

Set fso = CreateObject("Scripting.FileSystemObject")
PP = "D:/Inetpub/..yaddatadda../www/" 'Physical Path
Set f = fso.GetFolder(PP)
Set fc = f.Files

and it works fine.

I'm not sure what I'm doing wrong. Is there something I'm missing here? Why does the almost exact same code work in one script but not the other?

View Replies View Related

'object Required' Error Using FileSystemObject

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 = fso.GetFolder("C:InetpubwwwrootMySitesubfolder")
Set fs = f.Files
For Each fl in fs
s = fl.Name 'Object Required error occurs here!
Response.Write(s)
Next
Set fso = Nothing

The asp page returns the 'Object Required' error on the line, "s = fl.Name". Why?

View Replies View Related

ActiveX Can't Create Object:"Scripting.FileSystemObject

I'm at a complete loss on what is causing this error. ActiveX Can't create object:"Scripting.FileSystemObject when executing the code below. Every example I've looked at is pretty much identical except for the file names.

What I am ultimately trying to accomplish is when clicking on a link check to see if a file with today's date exists if so link to it. If not, link to a file with yesterday's date.

View Replies View Related

Reusing Functions

I have been developping a webpage in ASP for about 4 weeks now and I have noticed that I am rewriting similar functions in pretty much every page i make. So I was wondering if there is a way to make some particular functions global so that you can use them in any page. The functions will depend on the session id, but I don't know if i can declare session functions or not.

View Replies View Related

Reusing Code...

Is there a way to make a page that simply holds a bunch of functions that you can call from other pages, much in the same way as you create a module in VB?

I am redeveloping some asp stuff I did last year, and would like to find a way to neaten up the code. It isn't really a problem to get the code to work and then just cut and paste it, but it does make the maintenance a bit tedious.

View Replies View Related

Reusing Recordsets

I'm sending a query in the page and if there are no recordsets returned, then i need to immediately send another query and print those results. here's my "non-working" code

[VBS]Set cn = server.CreateObject("ADODB.Connection")
cn.Open "Provider=SQLOLEDB; Data Source= SQLECM02; Initial Catalog= wwwapp; user id= ecm_user; Password = ecm_user"

Set rs = server.CreateObject("ADODB.Recordset")
rs.Open "Select url, fName, lName from users as u, role as r, security as s where u.ntID ='" & user & "' and u.roleid = r.roleid and s.securityLevelReq <= r.securitylevel and s.securityLevelReq > 0;", cn
if rs.BOF and rs.EOF Then
rs.clear
rs.Open "Select url from security where securitylevelreq = 0"
end if


[/VBS]

View Replies View Related

Reusing Paramter Values

How can I reuse a parameter assigned value for output in my HTML display. Please see the code where the parameter value is captured. Code:

View Replies View Related

Arrays Of Dictionary Object Stored In An Object?

I'll admit my ASP skills are very rusty, and come seeking help.

I'm currently using a dictionary object to store a multi-dimensional array.

I want to pass this dictionary object to an object, which holds an array of dictionary objects.

However I'm finding that the array is not getting set, thus I'm having great issue with dynamically resizing the object's property for every new dictionary object I'm adding.

View Replies View Related

Can VB Com Object Used By ASP Get Events Fired By An Internal Object?

I have a VC++ COM object which fires an event. I've written VB EXE apps against it and they receive the event notification.

I've now built a simple VB COM object which uses the VC++ COM object internally.

My question is, assuming the ASP page which loads the object does not immediately exit, will the VB COM object be able to receive the events from the internal object?

View Replies View Related

FileSystemObject

I am trying to attach files (all formats excel, word, including power point, pdf, any other embebbed files ...) on a form and copy them on to a specific folder. The code works only for text, word and excel formats but not for pdf, ppt, embbedded files. How could I add these files also?

I used this in the code:

Set oF= FSO.CreateTextFile("FolderNameFileName", True)

View Replies View Related

Filesystemobject

i have made a site that allows users to log in and download or upload a file. but now i want to put in a drop-down menu so they can select which file they want to download. I want to populate the drop-down menu with a list of files in a directory using filesystemobject so it can change depending on what user logs in. can anyone give me some idea of how to populate the drop-down menu using filesystemobject.

View Replies View Related

FileSystemObject

I am trying to see if an XML file exists and if it does then show the data in it if not do something else but can't seem to find the file. That definitely is the virtual path. Can you see anything wrong? Code:

View Replies View Related

FileSystemObject

I just want to be able to access a simple text file but I cant not seem to figure it out I have used the FileSystemObject in Javascript before! Can anyone point out the error in my ways!Code:

<html>
<head>
</head>
<body>
<%
Dim FSO,FILE
FSO=Server.CreateObject("Scripting.FileSystemObject")
FILE=FSO.CreateTextFile("c: est.txt",true)
FILE.WriteLine("Some Text!")
FILE.Close
FILE=nothing
FSO=nothing
%>
</body>
</html>

View Replies View Related

FileSystemObject

Can anyone tell me which protocol (http/s, RPC) or
service (w3svc) is used when using FileSystemObject in an
ASP page?

View Replies View Related

FileSystemObject

I can't create textfiles.I could last week, and I can on my spare server. But this week, my production server freezes when trying to write to the file System.

set ObjTextStream = fs.CreateTextFile(str, fsoForWriting)

Where should I start to look for the difference? Both servers are W2KSP3. Both have IIS 5.I've run virus scans with the latest updates and no viruses found. I did receive an error about Windows File Protection needed to update some files, but those were ftp related.

View Replies View Related

Filesystemobject

is there any way that you can delete blank lines from a file or prevent them from displaying

View Replies View Related

Filesystemobject

I am trying to read a file (in ASP....my first ASP project) and i get the following error

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method
/CP_Site_C/Default.asp, line 15

and line 15 is
fileStream = fso.OpenTextFile(filePath)

and the complete code is:

Dim fso, fileStream
Dim HitCnt, filePath

set fso = Server.CreateObject("Scripting.FileSystemObject")
filePath = "C:InetpubwwwrootCP_Site_CHitCount.txt"
fileStream = fso.OpenTextFile(filePath)

View Replies View Related

FileSystemObject

Ok, I've got several different RAW LOGS, which I want to anylise, with the FSO.

However, I haven't got the faintest idea how to actually do anything (usefull!). For example, I want to be able to set the date of a traffic rapport (e.g display details from 15/03/2003 'till 17/03/2003). I also want to get all the usuall stuff like pageviews, visits, visitors...etc

Can anyone help me how to get all this, and still maintain somewhat of performance of my webpages? Code:

View Replies View Related

FileSystemObject

This my code for practice:

<html>
<body>
<%
Response.Write("6 ")
dim fs,fname
set fs=CreateObject("Scripting.FileSystemObject")
set fname=fs.CreateTextFile("f: est.txt")
fname.WriteLine("Hello World!")
fname.Close
set fname=nothing
set fs=nothing
%>
</body>
</html>

but I couldn't create the text file at all with no error warning.How can I do this?

View Replies View Related

.FileSystemObject

I'm having intermittent trouble with the Scripting.FileSystemObject.Basically, I'm stress testing my ASP application and using the FSO to output lots of instrumentation/debug information to the same file.About 5 times within a 15 minute stress test, it returns "Permission Denied". I would think that this object is capable of asynchronous file open and writes.Has anyone else seen this issue and been able
to resolve it?

View Replies View Related

FileSystemObject

I have serious problem with FileSystemObject, When I try to create object it saysInvalid Class String

It seems that FileSystemObject is removed or currupted. Could any know how can I re-install FileSystemObject it or fix this problem

View Replies View Related

FileSystemObject

In my ASP (IIS 5.1), when I use oFile.OpenTextFile to open a file, the code stucks.
How can I fix this problem?

set oFile = CreateObject("Scripting.FileSystemObject")
strServerFileName = "files/fieldmap.txt"
If (oFile.FileExists(server.mappath(strServerFileName ))) Then
Const ForReading = 1
Set fSubmit = oFile.OpenTextFile(server.mappath(strServerFileNam e),
ForReading, False) --->>
end if

View Replies View Related

Filesystemobject

I'm using the filesystemobject to list all files in a directory

Code:
Function lagsangliste()
dim fso, tekstmappe, file
set fso = Server.CreateObject("Scripting.FileSystemObject")
set tekstmappe = fso.Getfolder(Server.Mappath("/claus/tekster"))

response.write "<p class=sangliste>"
for each file in tekstmappe.files
Makelink_fullscreen(file.name)
Next

response.write "</p>"
End Function
But the filenames seems to come in random order.Is it possible to order them alphabetically?

View Replies View Related

FileSystemObject

Can the FileSystemObject be used to return the document title?I am using a script to return all files in a folder, but would like to display teh document title instead of the filename. Is there a way to do this?

View Replies View Related

FileSystemObject

i am having Permission problems with FileSystemObject.can any one guide me whats wrong?

set fs=Server.CreateObject("Scripting.FileSystemObject")
fcopy1=server.mappath("index_3.asp")
set t=fs.OpenTextFile(fcopy1,1,false)
x=t.ReadAll
t.close
'Response.Write("The text in the file is: " & x)
fcopy2=server.mappath("../site/samnik/content/index_3.asp")
set f=fs.CreateTextFile("fcopy2")
f.write(x)
Response.Write("<hr><a href=../site/samnik/content/index_3.asp>file is created</a>")
f.close

View Replies View Related

Using Filesystemobject

Im trying to get this filesystemobject code to access a different server then the one its sitting on. I am a admin on both servers. Is there anyway you can do this?

dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("")
Response.Write("Folder last accessed on: ")
Response.Write(fo.DateLastAccessed)
set fo=nothing
set fs=nothing

I havent heard of anyone trying this before, but I hope its possible.

View Replies View Related

Filesystemobject

How do you set the permissions to allow filesystemobject? I have already gone into iis and set the write permissions but that did not do it.Code:

set fso = createobject("scripting.filesystemobject")

Set act = fso.CreateTextFile(server.mappath(file_being_created), true)

View Replies View Related

FileSystemObject

I keep getting this error when I try to run the application. Could some one tell me what triggers this error.It was working fine and all of a sudden I started getting this error.

View Replies View Related

FileSystemObject

How would I go about deleting a data in a text file?

ex:test.txt

123 123
1234 1234
12345 12345

how would I use FileSystemObject to delete the 12345 line

View Replies View Related

Use FileSystemObject

I'm trying to write some simple code using FSO, but I can't make it work. There are a many FSO tutorials on the web, but they all start with a line similar to:

set fs=Server.CreateObject("Scripting.FileSystemObject")

Yet that line simply doesn't work. I've tried it on my server and on my development PC, both of which are configured as web servers running ASP. I suspect that these computers simply aren't configured to support FSO, but nowhere can I find any hint of how to do that configuration.

View Replies View Related

FileSystemObject

I've been using the FileSystemObject to try to save various html files as .htm files. I have been pulling down the code correctly (its our website, we are needing the database driven pages stored statically on cd, hence we are automising the process) I have the HTML in strings, replaced all the links I need to, and when I try to write to the file via the fs.write(HTMLCode) it doesn't work, I've tried many approaches .

View Replies View Related

FileSystemObject

When dealing with the FileSystemObject component, I found that attempting to use the fso.GetFile(path) method (where fso was set using the CreateObject method, and path is set to the physical path of the file) was completely hanging IIS, that I had to restart it to get anything going. PLacing traces and breakpoints up to that point showed that this is the method causing the hand. The folder in which this file resides has only about 10 files in it.

I'm running on Windows 2000 SP4 with IIS 5.0. I also have Norton AV 2002 installed and I tried disabling it in case it is the culprit. Same result. All services that should be running appear to be in the correct (started) state. I also have Zone Alarm Pro running, but both IIS and the browser are running on the same machine, and the local host (127.0.0.1) is in the Trusted Zone.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved