I am trying it get an INCLUDED ASP page to successfully run within another ASP page.
The INCLUDED ASP page is the menu (which I am trying to render dynamically through contents of a database.) Normally the menu ASP is static and changed via FrontPage but the app that I am building requires that menu be static as input from users will change the content of the database and thus the menu.
Previewed separately, they ASP pages work fine (NO errors) however when they are combined and opened is when the cryptic unhelpful error occurs.
(Microsoft VBScript runtime error '800a01a8'
Object required: ''
/dev/kb/default.asp, line 50
)
I can only assume that the action that I am attempting is not valid.
The database is included in the menu.asp file which is in turn included in the default.asp page.
The connection to the database and recodset is controled in the menu.asp file (open, used and closed).
I hope that someone can help.
DEFAULT.ASP
MENU.ASP
db_kb.inc
adovbs.inc is just a standard ADO constants include file for VBScript
Thanks in advance for any help
The INCLUDED ASP page is the menu (which I am trying to render dynamically through contents of a database.) Normally the menu ASP is static and changed via FrontPage but the app that I am building requires that menu be static as input from users will change the content of the database and thus the menu.
Previewed separately, they ASP pages work fine (NO errors) however when they are combined and opened is when the cryptic unhelpful error occurs.
(Microsoft VBScript runtime error '800a01a8'
Object required: ''
/dev/kb/default.asp, line 50
)
I can only assume that the action that I am attempting is not valid.
The database is included in the menu.asp file which is in turn included in the default.asp page.
The connection to the database and recodset is controled in the menu.asp file (open, used and closed).
I hope that someone can help.
DEFAULT.ASP
Code:
<html>
<head>
<link REL="stylesheet" HREF="includes/default.css" TYPE="text/css">
<link REL="stylesheet" HREF="includes/hdr_n_nav.css" TYPE="text/css">
<title>Site Home Page Template</title>
</head>
<body>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td name="HeaderCell" id="HeaderCell" colspan="3"><a name="Top"></a><!--webbot bot="HTMLMarkup" ALT="<h4>The new Header is in place ...</h4>" TAG="XBOT" StartSpan -->
<IFRAME scrolling="no" width="100%" height="94" frameborder="0" marginheight="0" src="header.htm"></IFRAME><!--webbot BOT="HTMLMarkup" endspan -->
</td>
</tr>
<tr>
<td width="81%" valign="top" style="border: 0" colspan="2">
<!--webbot bot="Include" U-include="../../../includes/site_header.htm" TAG="BODY" --></td>
<td name="RightMarginCell" id="RightMarginCell" width="19%" rowspan="2"><img src="common/images/rightspacer.gif" width="78" hspace="60" height="1"><p><!--webbot bot="PurpleText" PREVIEW="do not modify." --></td>
</tr>
<tr>
<td name="MenuCell" id="MenuCell" valign="top" bgcolor="DDDDDD" style="border: 0">
<!--webbot bot="Include" U-include="menu.asp" TAG="BODY" --></td>
<td class="Content" name="ContentCell" id="ContentCell" width="80%" valign="top">
<h1>Welcome</h1>
<p class="Keyword">Keyword = Keyword Text</p>
<p>
Enter Site Content
</p>
</td>
</tr>
<tr>
<td name="FooterCell" id="FooterCell" class="CellColorLighter"></td>
<td name="Footer" id="Footer" colspan="2">
<!--webbot bot="Include" U-include="../../../includes/footer.htm" TAG="BODY" --></td>
</tr>
</table>
</body>
</html>
MENU.ASP
Code:
<!-- #INCLUDE file="includes/adovbs.inc" -->
<!-- #INCLUDE file="includes/db_kb.inc" -->
<%
Dim rstMenu, strSQLMenu
Set rstMenu = Server.CreateObject("ADODB.Recordset")
strSQLMenu = "SELECT DISTINCT tblCatagory.CID, tblCatagory.txt_Catagory_Title" & _
" FROM (tblCatagory RIGHT JOIN tblSubCatagory ON tblCatagory.CID = tblSubCatagory.[_CID])" & _
" RIGHT JOIN tblKnowledgebase ON tblSubCatagory.SCID = tblKnowledgebase.[_SCID]" & _
" ORDER BY tblCatagory.txt_Catagory_Title;"
rstMenu.Open strSQLMenu, adoCon
%>
<html>
<head>
<link REL="stylesheet" HREF="includes/default.css" TYPE="text/css">
<link REL="stylesheet" HREF="includes/hdr_n_nav.css" TYPE="text/css">
<title>Menu Exampletitle>
</head>
<body>
<table name="Menu" id="Menu" border="0" width="250" cellspacing="0" cellpadding="0">
<tr class="menuhead">
<td class="menuheadcell"><a href="default.asp">Site Home</a> </td>
</tr>
<tr class="menuhead">
<td class="menuheadcell"><a href="menulevel1.asp">Menu Level Page</a></td>
</tr>
<%
If rstMenu.RecordCount < 0 Then
rstMenu.MoveFirst
Do While Not rstMenu.EOF
%>
<tr class="menuitem">
<td class="menuitemcell">
<a href="view_catagory.asp?ID=<%=rstMenu.Fields("CID")%>"><%=rstMenu.Fields("txt_Catagory_Title")%></a>
</td>
</tr>
<%
rstMenu.MoveNext
Loop
End If
%>
<tr class="menuitem">
<td class="menuitemcell"><a href="menulevel2.asp">Sub-Menu Level Page</a></td>
</tr>
<tr class="menuhead">
<td class="menuheadcell"><a href="sitesearch.htm">Site Search Page</a></td>
</tr>
</table>
<script language="Javascript" src="scripts/menu.js"></script>
<%
rstMenu.Close
Set rstMenu = Nothing
adoCon.Close
Set adoCon = Nothing
%>
</body>
</html>
db_kb.inc
Code:
<%
Dim adoCon
Dim mydb
Set adoCon = Server.CreateObject("ADODB.Connection")
mydb = Server.MapPath("/virtual/do/data/database/kb.mdb")
adoCon.ConnectionString ="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & mydb
adoCon.Open
%>
adovbs.inc is just a standard ADO constants include file for VBScript
Thanks in advance for any help