Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileSystemObject question

Status
Not open for further replies.

fluxdemon

MIS
Nov 5, 2002
89
US
Does anybody see why this wouldn't work? Or setting on my local system that would keep it from working? I just loaded VS.Net v.2003 Enterprise Architect.

code below:
<%
dim objFSO, objFolder, objFile, varFile

On Error Resume Next

Set objFSO = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)

Set objFolder = fso.GetFolder(Server.MapPath(&quot;/scott/asp/daily/&quot;))

Set objFile = objFolder.Files

for each varFile in objFile
response.write(varFile.name & &quot;<br>&quot;)
next

Set objFile = nothing
Set objFolder = nothing
Set objFSO = nothing
%>
 
did you take this out and see what it states
On Error Resume Next

_____________________________________________________________________
Please help! I'm falling asleep over here!
onpnt2.gif

 
? Don't know what you mean... I had the code work for me several days ago but now doesn't print or give an error
 
if you have on error resume next then you should have
if err.number <> 0 Then
response.write &quot;Error is &quot; & Err.description
end if
bad form not to.

it doesn't make any sense not to if you have the line. if you take the on error resume next out you should see any errors that may be occuring

_____________________________________________________________________
Please help! I'm falling asleep over here!
onpnt2.gif

 
It's working now! Thanks! I had misnamed the object in the second line.

I assume that I can put this code where ever I need to trap errors?

if err.number <> 0 Then
response.write &quot;Error is &quot; & Err.description & &quot;<br>&quot;
end if

Could you please take a look at thread 333-631482? It's a bit more? complex... just to keep you awake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top