Can anyone help in figuring out what is wrong with the script below: - For I = 0 To UBound(arrArray)
-
If Val(arrArray(I)) = Val(varValue) Then
-
Array_Exists = True
-
Exit Function
-
End If
-
Next
-
Array_Exists = False
-
End Function
The accompanying error is
Microsoft VBScript runtime error '800a001c'
Out of stack space: 'Val'
Any info will be really appreciated.
Thanks.
11 6320
Well to kick this off are you sure you are sending a string to the val function? Personally I don't understand what your trying to do in this procedure however I would say to verify the info in both of the val functions to verify they are strings or convert them before trying to utilize that function. Use debug.print to verify that they have a value to start with then go from there.
I'd have to agree with Denburt. Unless you have somehow created reentrant code, I don't see how you could be running out of stack space. So perhaps you are passing some sort of really weird value to the Val() function.
If possible, I'd recommend you interrupt the code at the point where the error occurs, and examine the variables involved directly, rather than relying on Debug.Print (though that will probably be good enough, too). At the very least, it will be good debugging practice. :)
Thanks for the replies. Perhaps I didn't clarify myself very well. I've never written a code before. What I wanted to do was edit my website, when I got this error: Microsoft VBScript runtime error '800a001c' Out of stack space: 'Val' /admin/content/pages.asp, line 7
Let me paste the folder in question, then perhaps you can tell me where I have to insert something.
Here we go: -
<!-- #include virtual="/includes/common.asp" -->
-
<%
-
Function Array_Exists(arrArray, varValue)
-
Dim I
-
-
For I = 0 To UBound(arrArray)
-
If Val(arrArray(I)) = Val(varValue) Then
-
Array_Exists = True
-
Exit Function
-
End If
-
Next
-
Array_Exists = False
-
End Function
-
-
Function GetExpandedPagesArray(arrPages, lngActivePageID, bolExpandLast)
-
GetExpandedPagesArray = Split(GetExpandedPagesCSV(arrPages, lngActivePageID, bolExpandLast), ",")
-
End Function
-
-
Function GetExpandedPagesCSV(arrPages, lngActivePageID, bolExpandLast)
-
Dim lngParentPageID, I, strTemp
-
-
If bolExpandLast Then
-
strTemp = lngActivePageID
-
End If
-
For I = 0 To UBound(arrPages, 2)
-
If arrPages(0, I) = lngActivePageID Then
-
lngParentPageID = arrPages(1, I)
-
If lngParentPageID > 0 Then
-
strTemp = strTemp & IIf(strTemp = "", "", ",") & GetExpandedPagesCSV(arrPages, lngParentPageID, True)
-
End If
-
End If
-
Next
-
GetExpandedPagesCSV = strTemp
-
End Function
-
-
Sub BuildTree(objTree, arrPages, lngParentPageID)
-
Dim I, strParentKey, strLinkText, strIcon
-
-
For I = 0 To UBound(arrPages, 2)
-
If arrPages(1, I) = lngParentPageID Then
-
strParentKey = IIf(lngParentPageID = 0, "root", "page" & lngParentPageID)
-
strLinkText = arrPages(2, I)
-
If Not arrPages(3, I) Then strLinkText = "<font color=""#777777"">" & strLinkText & "</font>"
-
If lngParentPageID = 0 Then strLinkText = "<b>" & strLinkText & "</b>"
-
If IsNull(arrPages(5, I)) Then
-
If arrPages(4, I) = "" Then
-
strIcon = "page.gif"
-
Else
-
strIcon = "link.gif"
-
End If
-
Else
-
strIcon = arrPages(5, I)
-
End If
-
strLinkText = "<a href=""page.asp?id=" & arrPages(0, I) & """ target=""edit"" onclick=""ob_ft(this.parentElement);"" oncontextmenu=""ob_ft(this.parentElement); ShowPageMenu(" & arrPages(0, I) & ",this); return false;"">" & strLinkText & "</a>"
-
-
objTree.Add strParentKey, "page" & arrPages(0, I), strLinkText, Array_Exists(arrExpanded, arrPages(0, I)), strIcon
-
BuildTree objTree, arrPages, arrPages(0, I)
-
End If
-
Next
-
End Sub
-
-
lngParentPageID = Val(Request("parentpageid"))
-
lngPageID = Val(Request("pageid"))
-
-
strSQL = _
-
"SELECT P.ID, P.ParentPageID, P.Title, P.ShowInMenu, P.RedirectURL, T.Icon " & _
-
"FROM Pages P " & _
-
"LEFT OUTER JOIN PageTemplates T ON T.ID=P.TemplateID " & _
-
"WHERE P.DateDeleted IS NULL " & _
-
"ORDER BY SortOrder"
-
Set rsPages = objConn.Execute(strSQL)
-
arrPages = rsPages.GetRows()
-
-
arrExpanded = GetExpandedPagesArray(arrPages, lngParentPageID, True)
-
-
Set objTree = Server.CreateObject("obout_asptreeview_pro.tree")
-
objTree.Add "", "root", "pensionsraadgivere.dk", True, "ie_link.gif"
-
BuildTree objTree, arrPages, 0
-
If lngPageID > 0 Then
-
objTree.SelectedNode_Id = "page" & lngPageID
-
End If
-
objTree.SelectedNode_Enable = False
-
strHTML = objTree.HTML
-
strHTML = Replace(strHTML, "<table cellspacing=5 cellpadding=5 border=1><tr><td style=""font:11px verdana;"" align=center> <br><a href=""http://www.ASPTreeView.com"">www.ASPTreeView.com</a> <br> <br> Evaluation has expired<br> <br><a href=""http://www.obout.com/obout/treeview/xp_treeview.asp#tableLicense""> Purchase info </a><br> </td></tr></td></tr></table>", "")
-
%>
-
<!-- #include virtual="/includes/adminframepagetop.asp" -->
-
<script>
-
var lngSelectedPageID = 0;
-
-
function ShowPageMenu(lngPageID) {
-
lngSelectedPageID = lngPageID;
-
document.PopupMenu.popup(event.x,event.y);
-
}
-
-
function OpenPage() {
-
parent.frames["edit"].navigate("page.asp?id="+lngSelectedPageID)
-
}
-
-
function NewPage() {
-
parent.frames["edit"].navigate("page.asp?parentpageid="+lngSelectedPageID)
-
}
-
-
function MovePageUp() {
-
parent.frames["edit"].navigate("page.asp?mode=move&dir=-1&id="+lngSelectedPageID)
-
}
-
-
function MovePageDown() {
-
parent.frames["edit"].navigate("page.asp?mode=move&dir=1&id="+lngSelectedPageID)
-
}
-
-
function DeletePage() {
-
if (sure()) {
-
parent.frames["edit"].navigate("page.asp?mode=delete&id="+lngSelectedPageID)
-
}
-
}
-
-
</script>
-
<APPLET
-
NAME = "PopupMenu"
-
CODE = "PopupMenuApplet.class"
-
CODEBASE= "/admin/"
-
WIDTH= "0"
-
HEIGHT= "0"
-
MAYSCRIPT
-
>
-
-
<PARAM NAME="DATA" VALUE="
-
{Åbn*javascript:OpenPage()*}
-
{HR}
-
{Ny underside...*javascript:NewPage()*}
-
{HR}
-
{Flyt op*javascript:MovePageUp()*}
-
{Flyt ned*javascript:MovePageDown()*}
-
{HR}
-
{Slet*javascript:DeletePage()*}
-
">
-
-
</APPLET><br>
-
<table width="100%" border="0" cellspacing="0" cellpadding="3">
-
<tr>
-
<td>
-
<%= strHTML %>
-
</td>
-
</tr>
-
</table>
-
<!-- #include virtual="/includes/adminframepagebottom.asp" -->
I would start somewhere around line 71... This code is pretty sloppy (no offense) but I can try to help.
The code is opening a recordset here but there are no checks in place to verify that the recordset has any records. This is one reason you may be getting your error. Even if it isn't I would at least try to put a check in here to make sure it won't happen. -
Set rsPages = objConn.Execute(strSQL)
-
'Something like this:
-
If rsPages.eof then exit Function
-
arrPages = rsPages.GetRows()
-
arrExpanded
This code appears to have many issues such as this but start here and just clean it up let us know whether this helps.
Now it gives this error: Microsoft VBScript compilation error '800a040f'
Invalid 'exit' statement
/admin/content/pages.asp, line 72
If rsPages.eof then exit
Did you say there was nothing wrong with line 7? That seems to be where the initial error came from.
The Exit function doesn't work becuase your not in a function (not in a sub either) So you'll have to do something like this for that section of the code: - Set rsPages = objConn.Execute(strSQL)
-
if not rsPages.EOF then
-
arrPages = rsPages.GetRows()
-
arrExpanded = GetExpandedPagesArray(arrPages, lngParentPageID, True)
-
-
Set objTree = Server.CreateObject("obout_asptreeview_pro.tree")
-
objTree.Add "", "root", "pensionsraadgivere.dk", True, "ie_link.gif"
-
BuildTree objTree, arrPages, 0
-
If lngPageID > 0 Then
-
objTree.SelectedNode_Id = "page" & lngPageID
-
End If
-
objTree.SelectedNode_Enable = False
-
end if
-
strHTML = objTree.HTML
-
strHTML = Replace(strHTML, "<table cellspacing=5 cellpadding=5 border=1><tr><td style=""font:11px verdana;"" align=center> <br><a href=""http://www.ASPTreeView.com"">www.ASPTreeView.com</a> <br> <br> Evaluation has expired<br> <br><a href=""http://www.obout.com/obout/treeview/xp_treeview.asp#tableLicense""> Purchase info</a><br> </td></tr></td></tr></table>", "")
I just reviewed the code earlier and thought it was in a function however this is not the case it appears to be stand alone code that runs when the page opens.
Try adding an if statement similar to what I provided checking to see that it isn't EOF if it isn't then run the rest of the code: -
<!-- #include virtual="/includes/common.asp" -->
-
<%
-
Function Array_Exists(arrArray, varValue)
-
Dim I
-
-
For I = 0 To UBound(arrArray)
-
If Val(arrArray(I)) = Val(varValue) Then
-
Array_Exists = True
-
Exit Function
-
End If
-
Next
-
Array_Exists = False
-
End Function
-
-
Function GetExpandedPagesArray(arrPages, lngActivePageID, bolExpandLast)
-
GetExpandedPagesArray = Split(GetExpandedPagesCSV(arrPages, lngActivePageID, bolExpandLast), ",")
-
End Function
-
-
Function GetExpandedPagesCSV(arrPages, lngActivePageID, bolExpandLast)
-
Dim lngParentPageID, I, strTemp
-
-
If bolExpandLast Then
-
strTemp = lngActivePageID
-
End If
-
For I = 0 To UBound(arrPages, 2)
-
If arrPages(0, I) = lngActivePageID Then
-
lngParentPageID = arrPages(1, I)
-
If lngParentPageID > 0 Then
-
strTemp = strTemp & IIf(strTemp = "", "", ",") & GetExpandedPagesCSV(arrPages, lngParentPageID, True)
-
End If
-
End If
-
Next
-
GetExpandedPagesCSV = strTemp
-
End Function
-
-
Sub BuildTree(objTree, arrPages, lngParentPageID)
-
Dim I, strParentKey, strLinkText, strIcon
-
-
For I = 0 To UBound(arrPages, 2)
-
If arrPages(1, I) = lngParentPageID Then
-
strParentKey = IIf(lngParentPageID = 0, "root", "page" & lngParentPageID)
-
strLinkText = arrPages(2, I)
-
If Not arrPages(3, I) Then strLinkText = "<font color=""#777777"">" & strLinkText & "</font>"
-
If lngParentPageID = 0 Then strLinkText = "<b>" & strLinkText & "</b>"
-
If IsNull(arrPages(5, I)) Then
-
If arrPages(4, I) = "" Then
-
strIcon = "page.gif"
-
Else
-
strIcon = "link.gif"
-
End If
-
Else
-
strIcon = arrPages(5, I)
-
End If
-
strLinkText = "<a href=""page.asp?id=" & arrPages(0, I) & """ target=""edit"" onclick=""ob_ft(this.parentElement);"" oncontextmenu=""ob_ft(this.parentElement); ShowPageMenu(" & arrPages(0, I) & ",this); return false;"">" & strLinkText & "</a>"
-
-
objTree.Add strParentKey, "page" & arrPages(0, I), strLinkText, Array_Exists(arrExpanded, arrPages(0, I)), strIcon
-
BuildTree objTree, arrPages, arrPages(0, I)
-
End If
-
Next
-
End Sub
-
-
lngParentPageID = Val(Request("parentpageid"))
-
lngPageID = Val(Request("pageid"))
-
-
strSQL = _
-
"SELECT P.ID, P.ParentPageID, P.Title, P.ShowInMenu, P.RedirectURL, T.Icon " & _
-
"FROM Pages P " & _
-
"LEFT OUTER JOIN PageTemplates T ON T.ID=P.TemplateID " & _
-
"WHERE P.DateDeleted IS NULL " & _
-
"ORDER BY SortOrder"
-
Set rsPages = objConn.Execute(strSQL)
- If not rsPages.EOF then
-
arrPages = rsPages.GetRows()
-
-
arrExpanded = GetExpandedPagesArray(arrPages, lngParentPageID, True)
-
-
Set objTree = Server.CreateObject("obout_asptreeview_pro.tree")
-
objTree.Add "", "root", "pensionsraadgivere.dk", True, "ie_link.gif"
-
BuildTree objTree, arrPages, 0
-
If lngPageID > 0 Then
-
objTree.SelectedNode_Id = "page" & lngPageID
-
End If
-
objTree.SelectedNode_Enable = False
-
strHTML = objTree.HTML
-
strHTML = Replace(strHTML, "<table cellspacing=5 cellpadding=5 border=1><tr><td style=""font:11px verdana;"" align=center> <br><a href=""http://www.ASPTreeView.com"">www.ASPTreeView.com</a> <br> <br> Evaluation has expired<br> <br><a href=""http://www.obout.com/obout/treeview/xp_treeview.asp#tableLicense""> Purchase info </a><br> </td></tr></td></tr></table>", "")
-
- Else
- Response.Write "<p>No records found</p>"
- End IF
-
%>
-
<!-- #include virtual="/includes/adminframepagetop.asp" -->
-
<script>
-
var lngSelectedPageID = 0;
-
-
function ShowPageMenu(lngPageID) {
-
lngSelectedPageID = lngPageID;
-
document.PopupMenu.popup(event.x,event.y);
-
}
-
-
function OpenPage() {
-
parent.frames["edit"].navigate("page.asp?id="+lngSelectedPageID)
-
}
-
-
function NewPage() {
-
parent.frames["edit"].navigate("page.asp?parentpageid="+lngSelectedPageID)
-
}
-
-
function MovePageUp() {
-
parent.frames["edit"].navigate("page.asp?mode=move&dir=-1&id="+lngSelectedPageID)
-
}
-
-
function MovePageDown() {
-
parent.frames["edit"].navigate("page.asp?mode=move&dir=1&id="+lngSelectedPageID)
-
}
-
-
function DeletePage() {
-
if (sure()) {
-
parent.frames["edit"].navigate("page.asp?mode=delete&id="+lngSelectedPageID)
-
}
-
}
-
-
</script>
-
<APPLET
-
NAME = "PopupMenu"
-
CODE = "PopupMenuApplet.class"
-
CODEBASE= "/admin/"
-
WIDTH= "0"
-
HEIGHT= "0"
-
MAYSCRIPT
-
>
-
-
<PARAM NAME="DATA" VALUE="
-
{Åbn*javascript:OpenPage()*}
-
{HR}
-
{Ny underside...*javascript:NewPage()*}
-
{HR}
-
{Flyt op*javascript:MovePageUp()*}
-
{Flyt ned*javascript:MovePageDown()*}
-
{HR}
-
{Slet*javascript:DeletePage()*}
-
">
-
-
</APPLET><br>
-
<table width="100%" border="0" cellspacing="0" cellpadding="3">
-
<tr>
-
<td>
-
<%= strHTML %>
-
</td>
-
</tr>
-
</table>
-
<!-- #include virtual="/includes/adminframepagebottom.asp" -->
[/quote]
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/admin/content/pages.asp, line 143
Current error.
I just noticed danP managed a post while I was typing earlier. So you tried his post or mine or both? danP you are correct about it not being in a function and thank you for correcting me (I just noticed). The "end if" must reside after the objttree references or you will see an error when the recordset is EOF. You might exchange response.Write in my code for something to the effect of: - strHTML ="<p>No data found for the selected information</p>"
Do you guys feel I should throw this over to the ASP forum, or what?
Do you guys feel I should throw this over to the ASP forum, or what?
Done! It's now in the ASP forum.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: |
last post by:
I am accessing the same error-containing ASP page on an ISP server using w2k
IE6 but with different effect.
On the first computer I get several line of HTML outputed by ASP, shown
correctly by...
|
by: Mike Kanski |
last post by:
I get this error Microsoft VBScript runtime error '800a01fb'
When i call LoadPicture method, or when i pretty much do any operation with
PictureBox like setting width and height.
It happened...
|
by: Seeker |
last post by:
Hi!
I have to do some developing and I'm trying to configure my server to mimic
the operation of our production server. The issue I'm having is that I'm
trying to use CDONTS to send an email...
|
by: Matrix |
last post by:
I just got one virtual directory setup and try to run my web application from
there. I am getting following error
Microsoft VBScript runtime error '800a01a8'
Object required: 'Session'
I even...
|
by: PaulieS |
last post by:
Hi all.
Am migrating a customer from IIS5 on W2K server to IIS6 on W2K3.
Zipped all the websites and unzipped them to the identical locations
on new server. Used IISMT to migrate metabase.
...
|
by: anidmarty |
last post by:
Hey
I'm a Sysadmin and my users are getting this error on my production box.
It works fine on the dev box.
There is a script that is run that generates this error.
Production is clustered...
|
by: =?Utf-8?B?TWF0dCBDYWxob29u?= |
last post by:
HI there,
I am getting an error on my page which calls up a web service.
Microsoft VBScript runtime error '800a13ba'
Unknown runtime error: 'SearchQueryXML'
/SearchResults.asp, line 142
|
by: Concheso |
last post by:
Hi there!
I just created a login page. 1/3 of the login works fine, but some like "Lost Password" of "Admin access to add users" are not working.
Any help will be great!
The erros:
On...
|
by: .nLL |
last post by:
Erorr is
---------------------
Microsoft VBScript runtime error '800a0046'
Permission denied
/a.asp, line 3
-----------------------
|
by: morrisqueto |
last post by:
Hello,
One of my websites just started sending a new rare error. The site has been working for almost 2 years without trouble, but today morning started giving away this error in all my views.
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |