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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft VBScript v5.6

Status
Not open for further replies.

MSW

IS-IT--Management
Joined
Jan 9, 2002
Messages
48
Location
US
Hello I'm trying to create an ASP page in Front Page 2003 using MS VBScript v5.6 on my NT 4.0 Server.

When I try to run the ASP page I get this error:
Microsoft VBScript runtime error '800a01a8'

Object required: ''

/ohioad/contents.asp, line 23

Below is the script that I'm trying to use and I guess I really don't know for sure if the script is even getting to the VBScript software..

Thanks for your help..

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<%@LANGUAGE="VBSCRIPT" %>

<%
Dim strDocsPath, strDocsPhysicalPath
Dim objFSO, objFolder, strType, lngSize

' NOTE: set the following line to the folder to display
strDocsPath = "images"

' map the folder to a physical path
strDocsPhysicalPath = Server.MapPath(strDocsPath)

' create a system file object
Set objFolder = objFSO.GetFolder(strDocsPhysicalPath)

%>
<html>
<head>
<title>Table of Contents</title>
</head>

<body>

<h1 align="center">Table of Contents</h1>

<h4>Please choose the Document to view.</4>

<u1>
<%
' create a files collection
Set objFiles = objFolder.Files

' step through the files collection
For Each objFile in objFiles

' get a file's name
strName = objFile.Name

' make it lowercase for the URL
strFile = Lcase(strName)

' get the file's type
strType = objFile.Type

' make the name a title for display
strName = MakeTitle(strName)

' get the file size in KB
lngSize = objFile.Size\1024

' output the filename and URL
Response.Write ",<1i><a href=""" & strDocsPath & "/" & strFile & """>" &strName & "</a><br>"

Next

' this function drops the extension from the file
Function MakeTitle(strTemp)
If InStrRev(strTemp,".") Then
strTemp = Left(strTemp,InStrRev(strTemp,".")-1)
End If
MakeTitle = strTemp
End Function
%>
</u1>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top