Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Type Mismatch
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 12 May 2017 :  19:28:04  Show Profile  Reply with Quote
Wrote a program to read and display data about EBooks; but I'm getting a "type mismatch" error at line 91 (in red) when it tries to open an ".opf" file (XML/text). Anyone have an idea on how to solve this?


<%@ language = "VBScript"%>
<%
'Option Explicit
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-17 Michael Anderson, Pierre Gorissen,
'##                       Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; version 2 or later of the License.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in the
'## scripts and in the HTML output.  The "powered by" text/logo with a link back
'## to http://forum.snitz.com in the footer of the pages MUST remain visible when
'## the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful, but WITHOUT ANY
'## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
'## PARTICULAR PURPOSE.  See the GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License with this
'## program; if not, write to:
'##
'## Free Software Foundation, Inc.
'## 59 Temple Place - Suite 330
'## Boston, MA  02111-1307, USA
'##
'## Support can be obtained from our support forums at:  http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:  manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<%
Dim strTitle, strBTitle, FRead
strTitle = "EBook Details"
Response.Buffer = True
Err.Clear
Server.ScriptTimeout = 3600
%>
<!--#INCLUDE FILE="includes/inc_sha256.asp"-->
<!--#INCLUDE FILE="includes/inc_header.asp" -->
<%
'Call ModCheck()
Response.Write	"			<table border=""0"" bgColor=""transparent"" width=""100%"" align=""center"">" & vbNewLine &_
	"				<tr>" & vbNewLine &_
	"					<td width=""33%"" align=""left"" nowrap>" & vbNewLine & _
	"						<font face=""" & strDefaultFontface & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"							" & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"							" & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""" & scriptname & """>" & strTitle & "</a>" & vbNewLine & _
	"						</font>" & vbNewLine & _
	"					</td>" & vbNewLine & _
	"				</tr>" & vbNewLine & _
	"			</table>" & vbNewLine
If Request("strPath") Then
	strBTitle = Replace(Request("strPath"), "%20", " ")
	strPTitle = Replace(strBTitle, "/", " - ")
	strPTitle = Replace(strPTitle, "\", " - ")
	If Right(strPTitle, 3) = " - " Then strPTitle = Left(strPTitle, Len(strPTitle) - 3)
	strPath = Server.MapPath("ebooks/" & strBTitle) & "\"
	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
	If objFSO.FolderExists(strPath) Then
		Response.Write	"			<table class=""tbl"" align=""center"" bgColor=""" & strPopUpTableColor & """ cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbNewLine & _
			"				<tr>" & vbNewLine & _
			"					<td width=""100%"">" & vbNewLine & _
			"						<table align=""center"" width=""100%"" bgColor=""" & strTableBorderColor & """ cellpadding=""4"" border=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
			"							<tr>" & vbNewLine & _
			"								<td width=""100%"" colspan=""2"" align=""center"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
			"									<font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """><b>" & strPTitle & "</b></font>" & vbNewLine & _
			"								</td>" & vbNewLine & _
			"							</tr>" & vbNewLine & _
			"							<tr>" & vbNewLine & _
			"								<td width=""40%"" align=""absmiddle"" bgColor=""" & strForumCellColor & """>" & vbNewLine
		If objFSO.FileExists(strPath & "cover.jpg") Then
			Response.Write	"									<img src=""EBooks/" & strBTitle & "/cover.jpg" & """ height=""500"" />" & vbNewLine
		Else
			Response.Write	strPath & "cover.jpg doesn't exist." & vbNewLine
		End If
		Response.Write	"									</font>" & vbNewLine & _
			"								</td>" & vbNewLine
		strPath = strPath & "metadata.opf"
		If Not objFSO.FileExists(strPath) Then
			Response.Write	strPath & " metadata doesn't exist."
			TableClose
		Else
			strTemp = Replace(strPath, ".opf", ".txt")
			objFSO.MoveFile strPath, strTemp
			Set FRead = objFSO.OpenTextFile(strTemp, 1, 1) ' ForReading, Unicode format
			On Error Resume Next
'			Err.Clear
			If Err.Description > "" Then
				Response.Write	"								<td align=""center"" bgColor=""" & strForumCellColor & """ width=""60%"">" & vbNewLine & _
					"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & Err.Description & "</font>" & vbNewLine
				objFSO.MoveFile strTemp, strPath
				Set FRead = Nothing
				Set objFSO = Nothing
				TableClose
			End If
			Do
				Response.Flush
				strLine = FRead.ReadLine
				intLen = Len(strLine)
				If InStr(strLine, "<dc:identifier opf:scheme=") > 0 And InStr(strLine, "ISBN") > 0 Then strISBN = Mid(strLine, 38, intLen - 54)
				If InStr(strLine, "subject") > 0 Then strSubj = strSubj & Mid(strLine, 13, intLen - 25) & " "
				If InStr(strLine, "<dc:description>") > 0 Then
					strDescription = strDescription & strLine
					Do Until InStr(FRead.ReadLine, "</dc:description>") > 0
						strDescription = strDescription & FRead.ReadLine
					Loop
					strDescription = Replace(strDescription, "</dc:description>", "")
					strDescription = Replace(strDescription, "<dc:description>", "")
				End If
			Loop
			strSubj = "" : strDescription = ""
			FRead.Close
			Set FRead = Nothing
			strSubj = Trim(strSubj)
			Response.Write	"								<td width=""60%"" align=""center"" valign=""top"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
				"									<table align=""center"" cellpadding=""4"" border=""0""> " & vbNewLine & _
				"										<tr>" & vbNewLine & _
				"											<td align=""right"">" & vbNewLine & _
				"												<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>ISBN:</font>" & vbNewLine & _
				"											</td>" & vbNewLine & _
				"											<td>" & vbNewLine & _
				"												<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & strISBN & "</font>" & vbNewLine & _
				"											</td>" & vbNewLine & _
				"										</tr>" & vbNewLine & _
				"										<tr>" & vbNewLine & _
				"											<td align=""right"">" & vbNewLine & _
				"												<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>Genre(s):</font>" & vbNewLine & _
				"											</td>" & vbNewLine & _
				"											<td>" & vbNewLine & _
				"												<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & strSubj & "</font>" & vbNewLine & _
				"											</td>" & vbNewLine & _
				"										</tr>" & vbNewLine & _
				"										<tr valign=""top"">" & vbNewLine & _
				"											<td align=""right"">" & vbNewLine & _
				"												<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>Description:</font>" & vbNewLine & _
				"											</td>" & vbNewLine & _
				"											<td>" & vbNewLine & _
				"												<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """><p align=""justify"">" & strDescription & "</p></font>" & vbNewLine & _
				"											</td>" & vbNewLine & _
				"										</tr>" & vbNewLine & _
				"									</table>" & vbNewLine & _
				"								</td>" & vbNewLine
			objFSO.MoveFile strTemp, strPath
			TableClose
		End If
	Else
		Response.Write	strPath & " does not exist."
	End If
	TableClose
ElseIf Trim(Request.QueryString("Ltr")) > "" Then
	Response.Write	"			<table class=""tbl"" align=""center"" bgColor=""" & strPopUpTableColor & """ cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbNewLine & _
		"				<tr>" & vbNewLine & _
		"					<td width=""100%"">" & vbNewLine & _
		"						<table align=""center"" bgColor=""" & strTableBorderColor & """ cellpadding=""4"" border=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"							<tr>" & vbNewLine & _
		"								<td width=""100%"" colspan=""2"" align=""center"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
		"									<font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """><b>" & strTitle & "</b></font>" & vbNewLine & _
		"								</td>" & vbNewLine & _
		"							</tr>" & vbNewLine & _
		"							<tr>" & vbNewLine & _
		"								<td width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & vbNewLine
	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
	strPath = Server.MapPath("EBooks") & "\"
	If objFSO.FolderExists(strPath) Then
		Set objFolder = objFSO.GetFolder(strPath)
		ShowSubFolders(objFolder)
	Else
		Response.Write	"strPath " & strPath & " does not exist."
	End If
	Set objFolder = Nothing
	TableClose
Else
	Response.Write	"			<table class=""tbl"" align=""center"" bgColor=""" & strPopUpTableColor & """ cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbNewLine & _
		"				<tr>" & vbNewLine & _
		"					<td width=""100%"">" & vbNewLine & _
		"						<table align=""center"" bgColor=""" & strTableBorderColor & """ cellpadding=""4"" border=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"							<tr>" & vbNewLine & _
		"								<td width=""100%"" colspan=""2"" align=""center"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
		"									<font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """><b>" & strTitle & "</b></font>" & vbNewLine & _
		"								</td>" & vbNewLine & _
		"							</tr>" & vbNewLine & _
		"							<tr>" & vbNewLine & _
		"								<td width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
		"										<a title=""Titles starting with numbers"" href=""" & scriptname & "?Ltr=0"">#</a>  " & vbNewLine
	For i = 65 To 90
		Response.Write	"										<a title=""Titles starting with" & Chr(i) & """ href=""" & scriptname & "?Ltr=" & Chr(i) & """>" & Chr(i) & "</a>  " & vbNewLine
	Next
	TableClose
End If

Function TableClose
	Response.Write	"									</font>" & vbNewLine & _
		"								</td>" & vbNewLine & _
		"							</tr>" & vbNewLine & _
		"						</table>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"			</table>" & vbNewLine
	Set objFSO = Nothing
	WriteFooter
	Response.End
End Function

Sub ShowSubFolders(objFolder)
	Set colFolders = objFolder.SubFolders
	For Each objSubFolder In colFolders
		Response.Flush
		Set colFiles = objSubFolder.Files
		For Each objItem In colFiles
			Set objFile = objFSO.GetFile(objItem)
			If Right(objFile.Name, 4) = "mobi" Then
				strTitle = Mid(objSubFolder.Path,12)
				strTitle = Replace(strTitle,"\","/") & "/"
				intLen = Len(objFile.Name) - 5
				strLtr = UCase(Left(objFile.Name, 1))
				Ltr = Request.QueryString("Ltr")
				If (Ltr = "0" And (strLtr < "A" Or strLtr > "Z")) Or (strLtr = Ltr) Then			
					Response.Write	"<a href=""" & scriptname & "?strPath=" & strTitle & """>" & Left(objFile.Name, intLen) & "</a><br />" & vbNewLine
				End If
				Exit For
			End If
			Set objFile = Nothing
		Next
		ShowSubFolders(objSubFolder)
		Set colFiles = Nothing
	Next
	Set colFolders = Nothing
End Sub
%>

Edited by - Carefree on 14 June 2017 18:13:33

HuwR
Forum Admin

United Kingdom
20579 Posts

Posted - 13 May 2017 :  03:38:52  Show Profile  Visit HuwR's Homepage
shouldn't it be 0 for ASCII

Constant Value Description
TristateUseDefault 2 Opens the file using the system default.
TristateTrue 1 Opens the file as Unicode.
TristateFalse 0 Opens the file as ASCII.

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 02 June 2017 :  17:50:27  Show Profile
Yeah, forgot to change the comment. Didn't make any difference, though. Tried with 0, 1, True, False. Even renamed the file to .txt (since it's basically a text file) and opened it; same error.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20579 Posts

Posted - 04 June 2017 :  03:02:18  Show Profile  Visit HuwR's Homepage
have you tried

objFSO.OpenTextFile(strTemp, 1) or
objFSO.OpenTextFile(strTemp, 1, 0, 0)

could be confusing parameters

IIRC
objFSO.OpenTextFile(strTemp, 1,1)
means open strTemp for reading and create if not exists (since only three parameters passed, you either need to pass just two or all 4 params for what you are trying to do

FileSystemObject.OpenTextFile(fname,mode,create,format)

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 14 June 2017 :  18:19:06  Show Profile
Solved. The issue lies with XML formatting, had to use an entirely different approach.


<%@ language = "VBScript"%>
<%
'Option Explicit
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-17 Michael Anderson, Pierre Gorissen,
'##            Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; version 2 or later of the License.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in the
'## scripts and in the HTML output.  The "powered by" text/logo with a link back
'## to http://forum.snitz.com in the footer of the pages MUST remain visible when
'## the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful, but WITHOUT ANY
'## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
'## PARTICULAR PURPOSE.  See the GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License with this
'## program; if not, write to:
'##
'## Free Software Foundation, Inc.
'## 59 Temple Place - Suite 330
'## Boston, MA 02111-1307, USA
'##
'## Support can be obtained from our support forums at:  http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to: manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<%
Dim strTitle, strBTitle, FRead
strTitle = "EBook Details"
Response.Buffer = True
Server.ScriptTimeout = 3600
%>
<!--#INCLUDE FILE="includes/inc_sha256.asp"-->
<!--#INCLUDE FILE="includes/inc_header.asp" -->
<!--#INCLUDE FILE="includes/inc_func_secure.asp" -->
<%
Call ModCheck(intMod221)
If mLev < 1 Then
	Response.Redirect "login.asp"
ElseIf Not ChkForumAccess(intEBookForum, MemberID, False) Then
	Response.Redirect "default.asp"
End If
Response.Write "			<table border=""0"" bgColor=""transparent"" width=""100%"" align=""center"">" & vbNewLine & _
	"				<tr>" & vbNewLine &_
	"					<td width=""33%"" align=""left"" nowrap>" & vbNewLine & _
	"						<font face=""" & strDefaultFontface & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"						 " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"						 " & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""" & scriptname & """>" & strTitle & "</a>" & vbNewLine & _
	"						</font>" & vbNewLine & _
	"					</td>" & vbNewLine & _
	"				</tr>" & vbNewLine & _
	"			</table>" & vbNewLine
If Request("strPath") Then
	strBTitle = Replace(Request("strPath"), "%20", " ")
	strPTitle = Replace(strBTitle, "/", " - ")
	strPTitle = Replace(strPTitle, "\", " - ")
	If Right(strPTitle, 3) = " - " Then strPTitle = Left(strPTitle, Len(strPTitle) - 3)
	strPath = Server.MapPath("ebooks/" & strBTitle) & "\"
	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
	If objFSO.FolderExists(strPath) Then
		Response.Write "			<table class=""tbl"" align=""center"" width=""850"" bgColor=""" & strPopUpTableColor & """ cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbNewLine & _
			"					<tr>" & vbNewLine & _
			"						<td width=""100%"">" & vbNewLine & _
			"							<table align=""center"" width=""100%"" bgColor=""" & strTableBorderColor & """ cellpadding=""4"" border=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
			"								<tr>" & vbNewLine & _
			"									<td width=""100%"" colspan=""2"" align=""center"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
			"										<font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """><b>" & strPTitle & "</b></font>" & vbNewLine & _
			"									</td>" & vbNewLine & _
			"		 						</tr>" & vbNewLine & _
			"								<tr> valign=""top"">" & vbNewLine & _
			"									<td valign=""top"" width=""40%"" align=""absmiddle"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
			"										<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & vbNewLine
		If objFSO.FileExists(strPath & "cover.jpg") Then
			Response.Write "									<img src=""EBooks/" & strBTitle & "/cover.jpg" & """ height=""500"" />" & vbNewLine
		Else
			Response.Write strPath & "cover.jpg doesn't exist." & vbNewLine
		End If
		Response.Write "			</font>" & vbNewLine & _
			"			</td>" & vbNewLine
		strPath = strPath & "metadata.opf"
		If Not objFSO.FileExists(strPath) Then
			Response.Write strPath & " metadata doesn't exist."
			TableClose
		Else
			Set XMLDoc = Server.CreateObject("MSXML2.DOMDocument")
			XMLDoc.async = False
			strISBN = XRead(strPath, "dc:identifier")
			strTitle = XRead(strPath, "dc:title")
			strDescription = XRead(strPath, "dc:description")
			strSubj = XRead(strPath, "dc:subject")
			Set XMLDoc = Nothing
			Response.Write "						<td width=""60%"" align=""center"" valign=""top"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
				"						<table align=""center"" cellpadding=""4"" border=""0""> " & vbNewLine & _
				"							<tr>" & vbNewLine & _
				"								<td align=""right"">" & vbNewLine & _
				"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>ID:</font>" & vbNewLine & _
				"								</td>" & vbNewLine & _
				"								<td>" & vbNewLine & _
				"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & strISBN & "</font>" & vbNewLine & _
				"								</td>" & vbNewLine & _
				"			 				</tr>" & vbNewLine & _
				"							<tr>" & vbNewLine & _
				"								<td align=""right"">" & vbNewLine & _
				"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>Genre(s):</font>" & vbNewLine & _
				"								</td>" & vbNewLine & _
				"								<td>" & vbNewLine & _
				"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & strSubj & "</font>" & vbNewLine & _
				"								</td>" & vbNewLine & _
				"							</tr>" & vbNewLine & _
				"							<tr> valign=""top"">" & vbNewLine & _
				"								<td align=""right"">" & vbNewLine & _
				"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>Description:</font>" & vbNewLine & _
				"								</td>" & vbNewLine & _
				"								<td>" & vbNewLine & _
				"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """><p align=""justify"">" & strDescription & "</p></font>" & vbNewLine & _
				"								</td>" & vbNewLine & _
				"			 				</tr>" & vbNewLine & _
				"						</table>" & vbNewLine & _
				"					</td>" & vbNewLine
			TableClose
		End If
	Else
		Response.Write strPath & " does not exist."
	End If
	TableClose
ElseIf Trim(Request.QueryString("Ltr")) > "" Then
	Response.Write "				<table class=""tbl"" align=""center"" bgColor=""" & strPopUpTableColor & """ cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td width=""100%"">" & vbNewLine & _
		"							<table align=""center"" bgColor=""" & strTableBorderColor & """ cellpadding=""4"" border=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"								<tr>" & vbNewLine & _
		"									<td width=""100%"" colspan=""2"" align=""center"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
		"										<font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """><b>" & strTitle & "</b></font>" & vbNewLine & _
		"									</td>" & vbNewLine & _
		"							 </tr>" & vbNewLine & _
		"							<tr>" & vbNewLine & _
		"								<td width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"									<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & vbNewLine
	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
	strPath = Server.MapPath("EBooks") & "\"
	If objFSO.FolderExists(strPath) Then
		Set objFolder = objFSO.GetFolder(strPath)
		ShowSubFolders(objFolder)
	Else
		Response.Write "strPath " & strPath & " does not exist."
	End If
	Set objFolder = Nothing
	TableClose
Else
	Response.Write "				<table class=""tbl"" align=""center"" bgColor=""" & strPopUpTableColor & """ cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td width=""100%"">" & vbNewLine & _
		"							<table align=""center"" bgColor=""" & strTableBorderColor & """ cellpadding=""4"" border=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"								<tr>" & vbNewLine & _
		"									<td width=""100%"" colspan=""2"" align=""center"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
		"										<font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """><b>" & strTitle & "</b></font>" & vbNewLine & _
		"									</td>" & vbNewLine & _
		"		 						</tr>" & vbNewLine & _
		"								<tr>" & vbNewLine & _
		"									<td width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"										<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
		"			 								<a title=""Titles starting with numbers"" href=""" & scriptname & "?Ltr=0"">#</a>  " & vbNewLine
	For i = 65 To 90
		Response.Write "			 								<a title=""Titles starting with" & Chr(i) & """ href=""" & scriptname & "?Ltr=" & Chr(i) & """>" & Chr(i) & "</a>  " & vbNewLine
	Next
	TableClose
End If

Function TableClose
	Response.Write "										</font>" & vbNewLine & _
		"									</td>" & vbNewLine & _
		"								</tr>" & vbNewLine & _
		"							</table>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"				</table>" & vbNewLine
	Set objFSO = Nothing
	WriteFooter
	Response.End
End Function

Sub ShowSubFolders(objFolder)
	Set colFolders = objFolder.SubFolders
	For Each objSubFolder In colFolders
		Response.Flush
		Set colFiles = objSubFolder.Files
		For Each objItem In colFiles
			Set objFile = objFSO.GetFile(objItem)
			If Right(objFile.Name, 4) = "mobi" Then
				strTitle = Mid(objSubFolder.Path,12)
				strTitle = Replace(strTitle,"\","/") & "/"
				intLen = Len(objFile.Name) - 5
				strLtr = UCase(Left(objFile.Name, 1))
				Ltr = Request.QueryString("Ltr")
				If (Ltr = "0" And (strLtr < "A" Or strLtr > "Z")) Or (strLtr = Ltr) Then
					If intEBookDLs = 1 Then Response.Write "<a href=""ebooks/" & Replace(strTitle & objFile.Name, "%20", " ") & """ style=""text-decoration:none;""><img src=""" & strImageURL & "icon_DL.png"" height=""18"" /></a> "
					Response.Write "<a href=""" & scriptname & "?strPath=" & strTitle & """>" & Left(objFile.Name, intLen) & "</a><br />" & vbNewLine
				End If
				Exit For
			End If
			Set objFile = Nothing
		Next
		ShowSubFolders(objSubFolder)
		Set colFiles = Nothing
	Next
	Set colFolders = Nothing
End Sub

Function XRead(strPath, XTag)
	XMLDoc.Load(strPath)
	Set EList = XMLDoc.GetElementsByTagName(XTag)
	If XTag = "dc:identifier" Then
		If Len(EList.Item(0).Text) = 13 Then
			XRead = EList.Item(0).Text
		ElseIf Len(EList.Item(1).Text) = 13 Then
			XRead = EList.Item(1).Text
		ElseIf Len(EList.Item(2).Text) = 13 Then
			XRead = EList.Item(2).Text
		ElseIf Len(EList.Item(3).Text) = 13 Then
			XRead = EList.Item(3).Text
		ElseIf Len(EList.Item(4).Text) = 13 Then
			XRead = EList.Item(4).Text
		ElseIf Len(EList.Item(5).Text) = 13 Then
			XRead = EList.Item(5).Text
		Else
			XRead = EList.Item(0).Text
		End If
	Else
		XRead = EList.Item(0).Text
	End If
	Set EList = Nothing
End Function
%>
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20579 Posts

Posted - 15 June 2017 :  08:40:08  Show Profile  Visit HuwR's Homepage
so the fsoObject doesn't like XML then
Glad you figured it out in the end

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.46 seconds. Powered By: Snitz Forums 2000 Version 3.4.07