getting this error on my sitemap page (been working fine for 1½ years !)
its a 3rd party software cms but the error point to line 77 of sitemap.asp which is shown further below (sorry for the length)
but line 77 points to
lp = smma(1,i)
now the sp mnuTreeAll i have put into SQL QA and it runs fine - I have checked there are no duplicate p_page_id's in the table page_data which the SP runs off
any other ideas ?
much appreciated
gareth
sitemap.asp
-----------
<%
Dim pSiteMapDone, pSiteMapHEAD, pSiteMapBODY,pSITEMAPLEVELS
dim smma, sma, smdict, smm1in, smselpage
const SpacerImg = "images/space1.gif"
const ArrowImg = "images/arrowmap.gif"
Function SiteMapDisplayPages(cnt, level)
dim ci ' Current Index
dim cp ' Current Parent
If Level >= (pSITEMAPLEVELS)then Exit Function
cp = cnt
ci = smDict.Item(cp)
do while smma(1, ci) = cp ' Keep going while the same parent
' Check that that page is not hidden and that the user has the
' permissions to view the page
if (smma(9,ci)<>0) OR ((smma(6, ci) and maccess) = 0 AND smma(8,ci) <> 0) then
' Do Nothing and hide the item from the menu
else
title = smma(3,ci)
'title = replace(smma(3,ci), "'", "\'")
'title = replace(smma(3,ci), """", "\""")
pSiteMapBODY = pSiteMapBODY & "<div style=""padding-left:" & level*28 & "px; text-align: left;""><p><a href=""ILINK|" & smma(0,ci) & ",|"">" & title & "</a><span class=""invis"">.</span></p></div>" & vbCrLf
sma = sma + 1
SiteMapDisplayPages smma(0,ci), level+1
end if
ci = ci + 1
if ci > ubound(smma,2) then exit do
loop
End Function
Function SiteMapGenerate(Params, DBConn, PageID, ParentID, TopID)
Dim RS, CNN, SQL, i, lp, pcnt
Set cnn = CreateObject("ADODB.Connection")
cnn.Open DBConn
set objCmd = Server.CreateObject("ADODB.Command")
objCmd.ActiveConnection = CNN
objCmd.CommandType = &H0004
objCmd.CommandText = "mnuTreeAll"
set rs = objCmd.Execute
if rs.EOF then
rs.Close
cnn.Close
set cnn = nothing
set rs = nothing
pSiteMapHEAD = ""
pSiteMapBODY = ""
exit function
end if
smma = rs.GetRows()
rs.Close
CNN.Close
set CNN = nothing
set RS = nothing
'*********************************************************************
' We now have all the pages we need in an array, so map the
' parent IDs using a dictionary object to speed up access later
' And index the pages themselves for quicker look up
'*********************************************************************
set smdict = Server.CreateObject("Scripting.Dictionary")
lp = -1
for i = lbound(smma,2) to ubound(smma,2)
if smma(1,i) <> lp then
lp = smma(1,i)
smdict.Add lp, i
end if
next
sma = 0
SiteMapDisplayPages 0, 0
erase smma
'set smma = nothing
set smdict = nothing
pSiteMapdone = True
End Function
Function sitemapDisplay(Params, DBConn, PageID, ParentID, TopID)
pSITEMAPLEVELS = cint(ParamValue(Params,"maxlevels",99))
If pSiteMapdone <> true Then
SiteMapGenerate Params, DBConn, PageID, ParentID, TopID
objHEAD = pSiteMapHEAD
else
objHEAD = ""
End If
objBODY = pSiteMapBODY
objONLOAD = ""
objONRESIZE = ""
objONUNLOAD = ""
sitemapDisplay = True
End Function
Function sitemapIsSupported(Params, DBConn, PageID, ParentID, TopID, PublishType)
' We may need to do some database lookups to work out if the page can be
' published in a particular way
select case UCase(PublishType)
case "HTM"
sitemapIsSupported = True
case "ASP"
sitemapIsSupported = False
case else
sitemapIsSupported = False
end select
End Function
Function sitemapPublish(Params, DBConn, PageID, ParentID, TopID, PublishType)
sitemapPublish = False
End Function
%>
its a 3rd party software cms but the error point to line 77 of sitemap.asp which is shown further below (sorry for the length)
but line 77 points to
lp = smma(1,i)
now the sp mnuTreeAll i have put into SQL QA and it runs fine - I have checked there are no duplicate p_page_id's in the table page_data which the SP runs off
any other ideas ?
much appreciated
gareth
sitemap.asp
-----------
<%
Dim pSiteMapDone, pSiteMapHEAD, pSiteMapBODY,pSITEMAPLEVELS
dim smma, sma, smdict, smm1in, smselpage
const SpacerImg = "images/space1.gif"
const ArrowImg = "images/arrowmap.gif"
Function SiteMapDisplayPages(cnt, level)
dim ci ' Current Index
dim cp ' Current Parent
If Level >= (pSITEMAPLEVELS)then Exit Function
cp = cnt
ci = smDict.Item(cp)
do while smma(1, ci) = cp ' Keep going while the same parent
' Check that that page is not hidden and that the user has the
' permissions to view the page
if (smma(9,ci)<>0) OR ((smma(6, ci) and maccess) = 0 AND smma(8,ci) <> 0) then
' Do Nothing and hide the item from the menu
else
title = smma(3,ci)
'title = replace(smma(3,ci), "'", "\'")
'title = replace(smma(3,ci), """", "\""")
pSiteMapBODY = pSiteMapBODY & "<div style=""padding-left:" & level*28 & "px; text-align: left;""><p><a href=""ILINK|" & smma(0,ci) & ",|"">" & title & "</a><span class=""invis"">.</span></p></div>" & vbCrLf
sma = sma + 1
SiteMapDisplayPages smma(0,ci), level+1
end if
ci = ci + 1
if ci > ubound(smma,2) then exit do
loop
End Function
Function SiteMapGenerate(Params, DBConn, PageID, ParentID, TopID)
Dim RS, CNN, SQL, i, lp, pcnt
Set cnn = CreateObject("ADODB.Connection")
cnn.Open DBConn
set objCmd = Server.CreateObject("ADODB.Command")
objCmd.ActiveConnection = CNN
objCmd.CommandType = &H0004
objCmd.CommandText = "mnuTreeAll"
set rs = objCmd.Execute
if rs.EOF then
rs.Close
cnn.Close
set cnn = nothing
set rs = nothing
pSiteMapHEAD = ""
pSiteMapBODY = ""
exit function
end if
smma = rs.GetRows()
rs.Close
CNN.Close
set CNN = nothing
set RS = nothing
'*********************************************************************
' We now have all the pages we need in an array, so map the
' parent IDs using a dictionary object to speed up access later
' And index the pages themselves for quicker look up
'*********************************************************************
set smdict = Server.CreateObject("Scripting.Dictionary")
lp = -1
for i = lbound(smma,2) to ubound(smma,2)
if smma(1,i) <> lp then
lp = smma(1,i)
smdict.Add lp, i
end if
next
sma = 0
SiteMapDisplayPages 0, 0
erase smma
'set smma = nothing
set smdict = nothing
pSiteMapdone = True
End Function
Function sitemapDisplay(Params, DBConn, PageID, ParentID, TopID)
pSITEMAPLEVELS = cint(ParamValue(Params,"maxlevels",99))
If pSiteMapdone <> true Then
SiteMapGenerate Params, DBConn, PageID, ParentID, TopID
objHEAD = pSiteMapHEAD
else
objHEAD = ""
End If
objBODY = pSiteMapBODY
objONLOAD = ""
objONRESIZE = ""
objONUNLOAD = ""
sitemapDisplay = True
End Function
Function sitemapIsSupported(Params, DBConn, PageID, ParentID, TopID, PublishType)
' We may need to do some database lookups to work out if the page can be
' published in a particular way
select case UCase(PublishType)
case "HTM"
sitemapIsSupported = True
case "ASP"
sitemapIsSupported = False
case else
sitemapIsSupported = False
end select
End Function
Function sitemapPublish(Params, DBConn, PageID, ParentID, TopID, PublishType)
sitemapPublish = False
End Function
%>