Hello,
I'm getting a line error as follows
Error Type:
Microsoft VBScript runtime (0x800A0034)
Bad file name or number
/xc/staticScript/untitled0.asp, line 38
I have marked line 38 with -------------->>>>>>
If I replace
"call
createStaticPage(avarGeneral(0,i),avarGeneral(1,i),avarGeneral(2,i),avarGene
ral(3,i))"
with
"call
createStaticPage(avarGeneral(0,0),avarGeneral(1,0),avarGeneral(2,0),avarGene
ral(3,0))"
in order to maintain the loop but only call one set of input values all
works okay.
Thanks
Andrew.
****************************************************
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/XcapeSQL.asp" -->
<%
set metainfo = Server.CreateObject("ADODB.Recordset")
metainfo.ActiveConnection = MM_XcapeSQL_STRING
metainfo.Source = "{call dbo.metaInfo}"
metainfo.CursorType = 0
metainfo.CursorLocation = 2
metainfo.LockType = 3
metainf
pen()
metainfo_numRows = 0
if not metainfo.BOF OR NOT metainfo.EOF then
avarGeneral = metainfo.GetRows(10)
metainfo.close
set metainfo = nothing
end if
%>
<%
rows = UBound(avarGeneral, 2)
for i=0 to rows
call
createStaticPage(avarGeneral(0,i),avarGeneral(1,i),avarGeneral(2,i),avarGene
ral(3,i))
next
%>
<%
sub createStaticPage(propID, propName, resort, area)
strPropName = propName
strPropName = Replace(strPropName, " ", "_")
strResName = resort
strResName = Replace(strResName, " ", "_")
strAreaName = area
strAreaName = Replace(strAreaName, " ", "_")
Dim fs, file, path
Set fs = CreateObject("Scripting.FileSystemObject")
path = Server.MapPath("/xc/")&"\xc"&strResName&""
IF (fs.FolderExists(path)<>true)THEN
fs.CreateFolder(path)
END IF
-------------->>>>>>Set file = fs.CreateTextFile(path & "/" & strPropName
&".asp", true)
file.WriteLine("<"&"%")
file.WriteLine("intPropID = """&propID&"""")
file.WriteLine("%"&">")
file.WriteLine("<!--#include file=""../../Connections/XcapeSQL.asp"" -->")
file.WriteLine("<!--#include
file=""../../include/code/incStaticPageScript.asp""-->")
file.WriteLine("<!--#include file=""../../include/code/Recordsets.asp""-->")
file.WriteLine("<html>")
file.WriteLine("<head>")
file.WriteLine(" <!--#include file=""../../xc/include/head.asp""-->")
file.WriteLine("</html>")
file.Close
'Set file = Nothing
'Set fs = Nothing
'**************************************
'Dim 2fs, folder, files, fileName, 2path
Set fs = CreateObject("Scripting.FileSystemObject")
path = Server.MapPath("/xc/")&"\xc"&strResName&""
path2 = Server.MapPath("/xc/")&"\xc"&strAreaName&""
IF (fs.FolderExists(path2)<>true)THEN
fs.CreateFolder(path2)
END IF
If (fs.FolderExists(path)=true) Then
Set file = fs.CreateTextFile(path2&"/"&strResName&".asp", true)
Set folder = fs.GetFolder(path)
Set files = folder.files
For each fileName in files
strLinkName = Left(fs.GetFileName(fileName),
Len(fs.GetFileName(fileName))-4)
file.WriteLine("<a
href=""../xc"&strResName&"/"&fs.GetFileName(fileName)&""">"&strLinkName&"</a
Next
End If
file.Close
Set file = Nothing
Set files = nothing
Set folder = nothing
Set fs = nothing
'**************************************
END sub
response.redirect "StaticPage.asp"'?propID="&intPropID&""
%>
****************************************************************