|
 |
asp_ado_rds thread: Help ADO Directory Structure
Message #1 by psinghp@e... on Fri, 07 Dec 2001 19:53:04 +0400
|
|
--------------51595B5E7A1031D6B35A2D99
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi
I am using this code to display directory structure using ADO, Win2000, IIS5.0.
<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>
<body>
<%
Dim iLevel
Dim recRoot
Set recRoot = Server.CreateObject ("ADODB.Record")
recRoot.Open "","URL=http://Pagla/MyTest/"
Call Traverse(recRoot)
recRoot.Close
Sub Traverse(recNode)
Dim rsChildren
Dim recChildNode
' display the node name
Response.Write Space(iLevel * 2) & recNode("RESOURCE_PARSENAME")
' get any child nodes
Set rsChildren = recNode.GetChildren
' increase the indenting level
iLevel = iLevel + 1
' loop through the children
While Not rsChildren.EOF
' does this child contain other children
If rsChildren("RESOURCE_ISCOLLECTION") Then
recChildNode.Open rsChildren
Call Traverse(recChildNode)
recChildNode.Close
Else
Response.Write Space(iLevel * 2) & rsChildren("RESOURCE_PARSENAME")
End If
rsChildren.MoveNext
Wend
' decrease the indenting level
iLevel = iLevel - 1
' close the child recordset
rsChildren.Close
End Sub
%>
</body>
</html>
I am getting this error message at line 52 which corresponds to following
statement ( It is highlighted in the code as well)
recChildNode.Open rsChildren
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be
displayed.
--------------------------------------------------------------------------------
Please try the following:
Click the Refresh button, or try again later.
Open the pagla home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
--------------------------------------------------------------------------------
Technical Information (for support personnel)
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/test13/RecPage1.asp, line 52
Browser Type:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Page:
GET /test13/RecPage1.asp
Could some one help me solve this please.
TIA
Pepe
Message #2 by "Stephen Andrews" <my_ska@h...> on Mon, 10 Dec 2001 07:47:08 +1000
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0002_01C1814E.DE8317D0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
You forgot to instantiate the recChildNode you did the
RecRoot object (using Set recRoot = Server.CreateObject
("ADODB.Record")) also spaces are ignored in html so try wrapping the
space function like so:
Replace(Space(iLevel * 2)," ", " ")
This will add the same number of nbsp; elements instead of spaces.
Stephen Andrews
Aspect7 Software Developer
Newcastle NSW, Australia
-----Original Message-----
From: psinghp@e... [mailto:psinghp@e...]
Sent: Saturday, 8 December 2001 1:53 AM
To: ASP_ADO_RDS
Subject: [asp_ado_rds] Help ADO Directory Structure
Hi
I am using this code to display directory structure using ADO, Win2000,
IIS5.0.
<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>
<body>
<%
Dim iLevel
Dim recRoot
Set recRoot = Server.CreateObject ("ADODB.Record")
recRoot.Open "","URL=http://Pagla/MyTest/"
Call Traverse(recRoot)
recRoot.Close
Sub Traverse(recNode)
Dim rsChildren
Dim recChildNode
' display the node name
Response.Write Space(iLevel * 2) & recNode("RESOURCE_PARSENAME")
' get any child nodes
Set rsChildren = recNode.GetChildren
' increase the indenting level
iLevel = iLevel + 1
' loop through the children
While Not rsChildren.EOF
' does this child contain other children
If rsChildren("RESOURCE_ISCOLLECTION") Then
recChildNode.Open rsChildren
Call Traverse(recChildNode)
recChildNode.Close
Else
Response.Write Space(iLevel * 2) &
rsChildren("RESOURCE_PARSENAME")
End If
rsChildren.MoveNext
Wend
' decrease the indenting level
iLevel = iLevel - 1
' close the child recordset
rsChildren.Close
End Sub
%>
</body>
</html>
I am getting this error message at line 52 which corresponds to
following statement ( It is highlighted in the code as well)
recChildNode.Open rsChildren
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot
be displayed.
------------------------------------------------------------------------
--------
Please try the following:
Click the Refresh button, or try again later.
Open the pagla home page, and then look for links to the information you
want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
------------------------------------------------------------------------
--------
Technical Information (for support personnel)
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/test13/RecPage1.asp, line 52
Browser Type:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Page:
GET /test13/RecPage1.asp
Could some one help me solve this please.
TIA
Pepe
$subst('Email.Unsub')
$subst('Email.Unsub').
|
|
 |