Solved

ASP Sorting

Posted on 2001-07-09
15
264 Views
Last Modified: 2008-03-10
(Answer This And Get THe Points For http://www.experts-exchange.com/jsp/qManageQuestion.jsp?qid=20147463)

How Can I Sort The Array's In THe Following Code Alphabeticaly?: <%
response.write "<body bgcolor='#d3d3d3' text='#000000' link='#FF0000' vlink='#0000FF'>"
' newpath will be the directory name passed in the URL when we
' link to another directory
newpath = request.querystring("newpath")
folderspec = "/"
' we want to add a forward slash to the new path if the
' value of newpath isn't a zero-length string
if  newpath<>"" then
    folderspec = folderspec & newpath & "/"
end if
' now we will create our filesystem object
Set fs = CreateObject("Scripting.FileSystemObject")
' now we will define the folder and subfolders
Set folder = fs.GetFolder(server.mappath(folderspec))
Set subfolder = folder.subfolders
' let's return some HTML code here
response.write "<p><font face='arial' size='4'><strong>DIRECTORY</strong>&nbsp;"
' Now we've got to take the path represented by the variable
' newpath and trim off the last subdirectory so we can use that
' as a link to the directory above it. We will do that first
' checking if there is, indeed, a value for newpath, and if there
' is, we will search for a forward slash in the string, starting
' from the end of the string, and use that position as a pointer
' so we know how many characters to peel off of the string "newpath".
' Since the pointer is at the position of the forward slash and we
' don't want the forward slash to remain, we'll subtract 1 from it.
If newpath="" then
response.write "<br>"
end if
If newpath<>"" then
   Pointer = instrrev(newpath,"/")
' if the forward slash is found, we'll create the link to the
' directory above the current one.
    If Pointer>0 then
        UpOneLevel = Left(newpath,Pointer-1)
        response.write "<a href='" & request.servervariables("script_name")
        response.write "?newpath=" & UpOneLevel & "'><img src='up.gif' border='0'></a></p>"
' Now let's make provisions where the forward slash isn't found
    Else
        response.write "<a href='" & request.servervariables("script_name")
        response.write "'><img src='up.gif' border='0'></a></p>"
    End If
End If
' Now we can go through and add links to all the subfolders
For Each newfolder in subfolder
if newfolder.name = "Recycled" then
  arttem="t"
else
    response.write "<A HREF='"
    response.write request.servervariables("script_name")
' This is where I ran into problems...if newpath isn't a zero-length
' string, we won't want to add a forward slash, but we do want to add
' it if the value of newpath isn't a zero-length string
    If newpath="" then
        response.write "?newpath=" & newpath & newfolder.name
    Else
        response.write "?newpath=" & newpath & "/" & newfolder.name
    End If
    response.write "'>"
    response.write newfolder.name
    response.write "</A><br>"
end if
Next
' Ok, time to go grab those files in the current directory
' First we'll do a bit of HTML
response.write "<p><strong>Current directory = \" & folder.name & "</strong></p>"

Set filelist = folder.files
' iterate through the files and make them links
For Each file in filelist
    response.write "<A HREF='"
    response.write folderspec & file.name
    response.write "'>"
    response.write file.name & " - " & datevalue(file.datecreated) & " - " & file.size & " BYTES"
    response.write "</A><br>"
Next
' Now let's clean up after ourselves - destroy those objects
set folder=nothing
set subfolder=nothing
set filelist=nothing
set fs=nothing
' a little bit more HTML formatting and we're done!
 response.write "</font></body>"
%>
0
Comment
Question by:ottob
15 Comments
 

Expert Comment

by:webdude
ID: 6266709
i have no clue what u are asking...

sorry
0
 
LVL 1

Expert Comment

by:tkuppinen
ID: 6266763
0
 
LVL 5

Accepted Solution

by:
mattyk earned 300 total points
ID: 6266793
Here you go...I've indicated in the comments where I've edited your code:

-matty

-----------------------

<%
response.write "<body bgcolor='#d3d3d3' text='#000000' link='#FF0000' vlink='#0000FF'>"
' newpath will be the directory name passed in the URL when we
' link to another directory
newpath = request.querystring("newpath")
folderspec = "/"
' we want to add a forward slash to the new path if the
' value of newpath isn't a zero-length string
if  newpath<>"" then
   folderspec = folderspec & newpath & "/"
end if
' now we will create our filesystem object
Set fs = CreateObject("Scripting.FileSystemObject")
' now we will define the folder and subfolders
Set folder = fs.GetFolder(server.mappath(folderspec))
Set subfolder = folder.subfolders
' let's return some HTML code here
response.write "<p><font face='arial' size='4'><strong>DIRECTORY</strong>&nbsp;"
' Now we've got to take the path represented by the variable
' newpath and trim off the last subdirectory so we can use that
' as a link to the directory above it. We will do that first
' checking if there is, indeed, a value for newpath, and if there
' is, we will search for a forward slash in the string, starting
' from the end of the string, and use that position as a pointer
' so we know how many characters to peel off of the string "newpath".
' Since the pointer is at the position of the forward slash and we
' don't want the forward slash to remain, we'll subtract 1 from it.
If newpath="" then
response.write "<br>"
end if
If newpath<>"" then
  Pointer = instrrev(newpath,"/")
' if the forward slash is found, we'll create the link to the
' directory above the current one.
   If Pointer>0 then
       UpOneLevel = Left(newpath,Pointer-1)
       response.write "<a href='" & request.servervariables("script_name")
       response.write "?newpath=" & UpOneLevel & "'><img src='up.gif' border='0'></a></p>"
' Now let's make provisions where the forward slash isn't found
   Else
       response.write "<a href='" & request.servervariables("script_name")
       response.write "'><img src='up.gif' border='0'></a></p>"
   End If
End If
' Now we can go through and add links to all the subfolders
For Each newfolder in subfolder
if newfolder.name = "Recycled" then
 arttem="t"
else
   response.write "<A HREF='"
   response.write request.servervariables("script_name")
' This is where I ran into problems...if newpath isn't a zero-length
' string, we won't want to add a forward slash, but we do want to add
' it if the value of newpath isn't a zero-length string
   If newpath="" then
       response.write "?newpath=" & newpath & newfolder.name
   Else
       response.write "?newpath=" & newpath & "/" & newfolder.name
   End If
   response.write "'>"
   response.write newfolder.name
   response.write "</A><br>"
end if
Next
' Ok, time to go grab those files in the current directory
' First we'll do a bit of HTML
response.write "<p><strong>Current directory = \" & folder.name & "</strong></p>"

Set filelist = folder.files
' iterate through the files and make them links

'*********ADDED BY MATTY
Set rstFiles = Server.CreateObject("ADODB.Recordset")
rstFiles.Fields.Append "name", 200, 255
rstFiles.Fields.Append "size", 3
rstFiles.Fields.Append "date", 7
rstFiles.Fields.Append "type", 200, 255
rstFiles.Open

For Each objItem In filelist
      rstFiles.AddNew
      rstFiles.Fields("name").Value = objItem.Name
      rstFiles.Fields("size").Value = objItem.Size
      rstFiles.Fields("date").Value = objItem.DateCreated
      rstFiles.Fields("type").Value = objItem.Type
Next

rstFiles.Sort = "name ASC"

rstFiles.MoveFirst

Do While Not rstFiles.EOF
   response.write "<A HREF='"
   response.write folderspec & rstFiles.Fields("name").Value
   response.write "'>"
   response.write rstFiles.Fields("name").Value & " - " & datevalue(rstFiles.Fields("date").Value) & " - " & rstFiles.Fields("size").Value & " BYTES"
   response.write "</A><br>"
   rstFiles.MoveNext
Loop

'***************************Finish Edit

' Now let's clean up after ourselves - destroy those objects
set folder=nothing
set subfolder=nothing
set filelist=nothing
set fs=nothing
' a little bit more HTML formatting and we're done!
response.write "</font></body>"
%>

0
 

Author Comment

by:ottob
ID: 6267051
webdude,
You Obviously Didn't Do All Of The Following,
Read My Question Through And Look At The Code
But If You Goto:
http://24.187.1.18/
You'll See Things Aren't In Alphabetical Order.
My Question Is How Can Change THe Code To Get It To Be In Alphabetical Order  

tkuppinen,
The Address You Sent Me Too Might Work But I Long, Complex And Would Take Lots Of Work Incorperating It Into The Code I Have At Least In 2 Places. With A One Line Responce Such As Your's, I Will Work On It As A Last Resort And Give Points Accordingly.

Matty,
Your Answer At:
http://24.187.1.18/MATTY.asp
Gave Me This:

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/MATTY.asp, line 96, column 97
response.write rstFiles.Fields("name").Value & " - " & datevalue(rstFiles.Fields("date").Value) &
------------------------------------------------------------------------------------------------^

I Tried TO Figure Uot Why, But Since I Had Trouble Following Your Addition I Couldn't But I'm Gonna Work On It More Now.
0
 
LVL 3

Expert Comment

by:phuctran
ID: 6267226
your original code works fine on my machine.  However, Matty's code works fine with a little change: the line you pointed out is separated into two lines, you just need to place your cursor at the end of the first line then hit delete key once.
0
 

Author Comment

by:ottob
ID: 6267259
Yes I Fixed That Part Oh His
It Works Good In THe First Dir's But I Get EOF Errors 3 Directories Down
I'm Working On It

Question: When Youo Goto:
http://24.187.1.18/Dir6.asp
THe Folders And Files Are In Alphabetical Order?
0
 

Author Comment

by:ottob
ID: 6267298
Yes I Fixed That Part Oh His
It Works Good In THe First Dir's But I Get EOF Errors 3 Directories Down
I'm Working On It

Question: When Youo Goto:
http://24.187.1.18/Dir6.asp
THe Folders And Files Are In Alphabetical Order?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:ottob
ID: 6267326
Matty,
I Made This Fix (Code Below)
But I Have 2 Problems With It
1) It Gives Me Some Errors In Lower Directories.
Examples From:
http://24.187.1.18/MATTY2.asp
Most Of The Links Under The Full Album Link Give Me This Error:
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/MATTY2.asp, line 89

2)I Don't Know How To Use The Technique For The File Array In The Folder Array So They Are Not Alphabetised Yet.


<%
response.write "<body bgcolor='#d3d3d3' text='#000000' link='#FF0000' vlink='#0000FF'>"
' newpath will be the directory name passed in the URL when we
' link to another directory
newpath = request.querystring("newpath")
folderspec = "/"
' we want to add a forward slash to the new path if the
' value of newpath isn't a zero-length string
if newpath<>"" then
folderspec = folderspec & newpath & "/"
end if
' now we will create our filesystem object
Set fs = CreateObject("Scripting.FileSystemObject")
' now we will define the folder and subfolders
Set folder = fs.GetFolder(server.mappath(folderspec))
Set subfolder = folder.subfolders
' let's return some HTML code here
response.write "<p><font face='arial' size='4'><strong>DIRECTORY</strong>&nbsp;"
' Now we've got to take the path represented by the variable
' newpath and trim off the last subdirectory so we can use that
' as a link to the directory above it. We will do that first
' checking if there is, indeed, a value for newpath, and if there
' is, we will search for a forward slash in the string, starting
' from the end of the string, and use that position as a pointer
' so we know how many characters to peel off of the string "newpath".
' Since the pointer is at the position of the forward slash and we
' don't want the forward slash to remain, we'll subtract 1 from it.
If newpath="" then
response.write "<br>"
end if
If newpath<>"" then
Pointer = instrrev(newpath,"/")
' if the forward slash is found, we'll create the link to the
' directory above the current one.
If Pointer>0 then
UpOneLevel = Left(newpath,Pointer-1)
response.write "<a href='" & request.servervariables("script_name")
response.write "?newpath=" & UpOneLevel & "'><img src='up.gif' border='0'></a></p>"
' Now let's make provisions where the forward slash isn't found
Else
response.write "<a href='" & request.servervariables("script_name")
response.write "'><img src='up.gif' border='0'></a></p>"
End If
End If
' Now we can go through and add links to all the subfolders
For Each newfolder in subfolder
if newfolder.name = "Recycled" then
arttem="t"
else
response.write "<A HREF='"
response.write request.servervariables("script_name")
' This is where I ran into problems...if newpath isn't a zero-length
' string, we won't want to add a forward slash, but we do want to add
' it if the value of newpath isn't a zero-length string
If newpath="" then
response.write "?newpath=" & newpath & newfolder.name
Else
response.write "?newpath=" & newpath & "/" & newfolder.name
End If
response.write "'>"
response.write newfolder.name
response.write "</A><br>"
end if
Next
' Ok, time to go grab those files in the current directory
' First we'll do a bit of HTML
response.write "<p><strong>Current directory = \" & folder.name & "</strong></p>"

Set filelist = folder.files

'*********ADDED BY MATTY
Set rstFiles = Server.CreateObject("ADODB.Recordset")
rstFiles.Fields.Append "name", 200, 255
rstFiles.Fields.Append "size", 3
rstFiles.Fields.Append "date", 7
rstFiles.Fields.Append "type", 200, 255
rstFiles.Open

For Each objItem In filelist
rstFiles.AddNew
rstFiles.Fields("name").Value = objItem.Name
rstFiles.Fields("size").Value = objItem.Size
rstFiles.Fields("date").Value = objItem.DateCreated
rstFiles.Fields("type").Value = objItem.Type
Next

rstFiles.Sort = "name ASC"

rstFiles.MoveFirst

' iterate through the files and make them links
Do While Not rstFiles.EOF
response.write "<A HREF='"
response.write folderspec & rstFiles.Fields("name").Value
response.write "'>"
response.write rstFiles.Fields("name").Value
response.write " - "
response.write datevalue(rstFiles.Fields("date").Value)
response.write " - "
response.write rstFiles.Fields("size").Value
response.write " BYTES"
response.write "</A><br>"
rstFiles.MoveNext
Loop

'***************************Finish Edit

' Now let's clean up after ourselves - destroy those objects
set folder=nothing
set subfolder=nothing
set filelist=nothing
set fs=nothing
' a little bit more HTML formatting and we're done!
response.write "</font></body>"
%>

PS
phuctran,
I Appreciate Your Attention To This Question And Will Make Sure Your Taken Care Of As Far As Points Go.
0
 
LVL 3

Expert Comment

by:phuctran
ID: 6267377
>>Question: When Youo Goto:
http://24.187.1.18/Dir6.asp

Ottob,
they are not in order.
0
 
LVL 3

Expert Comment

by:phuctran
ID: 6267462
>>Question: When Youo Goto:
http://24.187.1.18/Dir6.asp

Ottob,
they are not in order.
0
 
LVL 3

Expert Comment

by:phuctran
ID: 6267485
In Matty's code:
change
  rstFiles.MoveFirst
to
  If objItem > 0 Then
    rstFiles.MoveFirst
  End If

PS. The points should go to Matty.  I just add modify his code to work.
0
 
LVL 3

Expert Comment

by:phuctran
ID: 6267523
Modified from Matty's code.  Full points should go to Matty.

I guess this is what you need.

<%@ Language=VBSCRIPT %>
<%
Response.Buffer = TRUE
Response.Expires = 0
Response.ExpiresAbsolute = Now - 1
%>

<%
response.write "<body bgcolor='#d3d3d3' text='#000000' link='#FF0000' vlink='#0000FF'>"
' newpath will be the directory name passed in the URL when we
' link to another directory
newpath = request.querystring("newpath")
folderspec = "/"
' we want to add a forward slash to the new path if the
' value of newpath isn't a zero-length string
if  newpath<>"" then
  folderspec = folderspec & newpath & "/"
end if
' now we will create our filesystem object
Set fs = CreateObject("Scripting.FileSystemObject")
' now we will define the folder and subfolders
Set folder = fs.GetFolder(server.mappath(folderspec))
Set subfolder = folder.subfolders
' let's return some HTML code here
response.write "<p><font face='arial' size='4'><strong>DIRECTORY</strong>&nbsp;"
' Now we've got to take the path represented by the variable
' newpath and trim off the last subdirectory so we can use that
' as a link to the directory above it. We will do that first
' checking if there is, indeed, a value for newpath, and if there
' is, we will search for a forward slash in the string, starting
' from the end of the string, and use that position as a pointer
' so we know how many characters to peel off of the string "newpath".
' Since the pointer is at the position of the forward slash and we
' don't want the forward slash to remain, we'll subtract 1 from it.
If newpath="" then
response.write "<br>"
end if
If newpath<>"" then
 Pointer = instrrev(newpath,"/")
' if the forward slash is found, we'll create the link to the
' directory above the current one.
  If Pointer>0 then
      UpOneLevel = Left(newpath,Pointer-1)
      response.write "<a href='" & request.servervariables("script_name")
      response.write "?newpath=" & UpOneLevel & "'><img src='up.gif' border='0'></a></p>"
' Now let's make provisions where the forward slash isn't found
  Else
      response.write "<a href='" & request.servervariables("script_name")
      response.write "'><img src='up.gif' border='0'></a></p>"
  End If
End If
' Now we can go through and add links to all the subfolders
'*********ADDED BY MATTY
  Dim rstFolders
  Set rstFolders = Server.CreateObject("ADODB.Recordset")
  rstFolders.Fields.Append "name", 200, 255
  rstFolders.Fields.Append "date", 7
  rstFolders.Open

  For Each newfolder in subfolder
    if newfolder.name = "Recycled" then
      arttem="t"
    else
      rstFolders.AddNew
      rstFolders.Fields("name").Value = newfolder.Name
    End If
  Next
 
  rstFolders.Sort = "name ASC"
 
  If objItem > 0 Then
    rstFolders.MoveFirst
  End If
 
  Do While Not rstFolders.EOF
    response.write "<A HREF='"
    response.write request.servervariables("script_name")
    ' This is where I ran into problems...if newpath isn't a zero-length
    ' string, we won't want to add a forward slash, but we do want to add
    ' it if the value of newpath isn't a zero-length string
    If newpath="" then
        response.write "?newpath=" & newpath & rstFolders.Fields("name").Value
    Else
        response.write "?newpath=" & newpath & "/" & rstFolders.Fields("name").Value
    End If
    response.write "'>"
    response.write rstFolders.Fields("name").Value
    response.write "</A><br>"

    rstFolders.MoveNext
  Loop

' Ok, time to go grab those files in the current directory
' First we'll do a bit of HTML
response.write "<p><strong>Current directory = \" & folder.name & "</strong></p>"

Set filelist = folder.files
' iterate through the files and make them links

'*********ADDED BY MATTY
  Set rstFiles = Server.CreateObject("ADODB.Recordset")
  rstFiles.Fields.Append "name", 200, 255
  rstFiles.Fields.Append "size", 3
  rstFiles.Fields.Append "date", 7
  rstFiles.Fields.Append "type", 200, 255
  rstFiles.Open
 
  For Each objItem In filelist
       rstFiles.AddNew
       rstFiles.Fields("name").Value = objItem.Name
       rstFiles.Fields("size").Value = objItem.Size
       rstFiles.Fields("date").Value = objItem.DateCreated
       rstFiles.Fields("type").Value = objItem.Type
  Next
 
  rstFiles.Sort = "name ASC"
 
  If objItem > 0 Then
    rstFiles.MoveFirst
  End If
 
  Do While Not rstFiles.EOF
    response.write "<A HREF='"
    response.write folderspec & rstFiles.Fields("name").Value
    response.write "'>"
    response.write rstFiles.Fields("name").Value & " - " & datevalue(rstFiles.Fields("date").Value) & " - " & rstFiles.Fields("size").Value & " BYTES"
    response.write "</A><br>"
    rstFiles.MoveNext
  Loop

'***************************Finish Edit

' Now let's clean up after ourselves - destroy those objects
rstFolders.Close
set rstFolders = Nothing
rstFiles.Close
set rstFiles = Nothing
set folder=nothing
set subfolder=nothing
set filelist=nothing
set fs=nothing
' a little bit more HTML formatting and we're done!
response.write "</font></body>"
%>
0
 

Author Comment

by:ottob
ID: 6267613
Matty,
Please Copy The Code From phuctran's Last Comment And Submit It As The Proposed Answer So I Can Give You These Points Properly.


Excelent Work phuctran.
You Are Right The Points Will Goto Matty, But I Have Points For You Also
Look For A Question Points For phuctran.
0
 

Author Comment

by:ottob
ID: 6267626
This Is The Working Code With Efforts From mattyk And  phuctran:


<%@ Language=VBSCRIPT %>
<%
Response.Buffer = TRUE
Response.Expires = 0
Response.ExpiresAbsolute = Now - 1
%>

<%
response.write "<body bgcolor='#d3d3d3' text='#000000' link='#FF0000' vlink='#0000FF'>"
' newpath will be the directory name passed in the URL when we
' link to another directory
newpath = request.querystring("newpath")
folderspec = "/"
' we want to add a forward slash to the new path if the
' value of newpath isn't a zero-length string
if  newpath<>"" then
 folderspec = folderspec & newpath & "/"
end if
' now we will create our filesystem object
Set fs = CreateObject("Scripting.FileSystemObject")
' now we will define the folder and subfolders
Set folder = fs.GetFolder(server.mappath(folderspec))
Set subfolder = folder.subfolders
' let's return some HTML code here
response.write "<p><font face='arial' size='4'><strong>DIRECTORY</strong>&nbsp;"
' Now we've got to take the path represented by the variable
' newpath and trim off the last subdirectory so we can use that
' as a link to the directory above it. We will do that first
' checking if there is, indeed, a value for newpath, and if there
' is, we will search for a forward slash in the string, starting
' from the end of the string, and use that position as a pointer
' so we know how many characters to peel off of the string "newpath".
' Since the pointer is at the position of the forward slash and we
' don't want the forward slash to remain, we'll subtract 1 from it.
If newpath="" then
response.write "<br>"
end if
If newpath<>"" then
Pointer = instrrev(newpath,"/")
' if the forward slash is found, we'll create the link to the
' directory above the current one.
 If Pointer>0 then
     UpOneLevel = Left(newpath,Pointer-1)
     response.write "<a href='" & request.servervariables("script_name")
     response.write "?newpath=" & UpOneLevel & "'><img src='up.gif' border='0'></a></p>"
' Now let's make provisions where the forward slash isn't found
 Else
     response.write "<a href='" & request.servervariables("script_name")
     response.write "'><img src='up.gif' border='0'></a></p>"
 End If
End If
' Now we can go through and add links to all the subfolders
'*********ADDED BY MATTY
 Dim rstFolders
 Set rstFolders = Server.CreateObject("ADODB.Recordset")
 rstFolders.Fields.Append "name", 200, 255
 rstFolders.Fields.Append "date", 7
 rstFolders.Open

 For Each newfolder in subfolder
   if newfolder.name = "Recycled" then
     arttem="t"
   else
     rstFolders.AddNew
     rstFolders.Fields("name").Value = newfolder.Name
   End If
 Next
 
 rstFolders.Sort = "name ASC"
 
 If objItem > 0 Then
   rstFolders.MoveFirst
 End If
 
 Do While Not rstFolders.EOF
   response.write "<A HREF='"
   response.write request.servervariables("script_name")
   ' This is where I ran into problems...if newpath isn't a zero-length
   ' string, we won't want to add a forward slash, but we do want to add
   ' it if the value of newpath isn't a zero-length string
   If newpath="" then
       response.write "?newpath=" & newpath & rstFolders.Fields("name").Value
   Else
       response.write "?newpath=" & newpath & "/" & rstFolders.Fields("name").Value
   End If
   response.write "'>"
   response.write rstFolders.Fields("name").Value
   response.write "</A><br>"

   rstFolders.MoveNext
 Loop

' Ok, time to go grab those files in the current directory
' First we'll do a bit of HTML
response.write "<p><strong>Current directory = \" & folder.name & "</strong></p>"

Set filelist = folder.files
' iterate through the files and make them links

'*********ADDED BY MATTY
 Set rstFiles = Server.CreateObject("ADODB.Recordset")
 rstFiles.Fields.Append "name", 200, 255
 rstFiles.Fields.Append "size", 3
 rstFiles.Fields.Append "date", 7
 rstFiles.Fields.Append "type", 200, 255
 rstFiles.Open
 
 For Each objItem In filelist
      rstFiles.AddNew
      rstFiles.Fields("name").Value = objItem.Name
      rstFiles.Fields("size").Value = objItem.Size
      rstFiles.Fields("date").Value = objItem.DateCreated
      rstFiles.Fields("type").Value = objItem.Type
 Next
 
 rstFiles.Sort = "name ASC"
 
 If objItem > 0 Then
   rstFiles.MoveFirst
 End If
 
 Do While Not rstFiles.EOF
   response.write "<A HREF='"
   response.write folderspec & rstFiles.Fields("name").Value
   response.write "'>"
   response.write rstFiles.Fields("name").Value & " - " & datevalue(rstFiles.Fields("date").Value)
& " - " & rstFiles.Fields("size").Value & " BYTES"
   response.write "</A><br>"
   rstFiles.MoveNext
 Loop

'***************************Finish Edit

' Now let's clean up after ourselves - destroy those objects
rstFolders.Close
set rstFolders = Nothing
rstFiles.Close
set rstFiles = Nothing
set folder=nothing
set subfolder=nothing
set filelist=nothing
set fs=nothing
' a little bit more HTML formatting and we're done!
response.write "</font></body>"
%>
0
 

Expert Comment

by:RedCCameleon
ID: 6343999
Accepting comment as the answer.

RedCCameleon,
Community Support Moderator @ Experts Exchange
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now