Ask a Question related to ASP Database, Design and Development.
-
nathan #1
Help! Dependent Lists with SQL Server (with code/db setup) assistance needed!
Hey folks, i'm _trying_ to get a dependent list box example working
from this example/tutorial found at
[url]http://www.asp101.com/resources/DependentLists.asp[/url]. The tutorial
originally had an access DB, but i've since changed that to sql server
(maybe thats the problem!?)
Well, i've run into plenty of problems doing this (ahh the joys of
learning eh!), but decided to keep with it. The error i am getting now
is as follows:
Error Type:
(0x80020009)
Exception occurred.
/traffic/TMP4yk8jopikk.asp, line 56
If anyone can point me in the right direction, well... you will have
made this guys weekend much less worry free! thanks people!
:::::INFO::::::
:::::MY DATABASE:::::
CATEGORY
Name Properties Desc
|-------------------------------------------
|category_id | Int Autonumber
|-------------------------------------------
|Category | varchar Name of the Category
|-------------------------------------------
SUBCATEGORY
Name Properties Desc
|------------------------------------------------------
|Subcategory_id | int Autonumber
|------------------------------------------------------
|Subcategory | varchar Name of the Subcategory
|------------------------------------------------
|Subcategory_of | varchar This category that this is a
subcategory of.
|------------------------------------------------------
:::::MY PAGE:::::
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/trafficbranch.asp" -->
<%
Dim rs
Dim rs_numRows
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_trafficbranch_STRING
rs.Source = "SELECT * FROM dbo.subcategory"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
rs_numRows = 0
%>
<%Response.Buffer = true%>
<HTML>
<HEAD>
<script language = "JavaScript">
function subcat()
cat = document.subad.catagory[document.subad.catagory.selectedIndex].value;
url = "submitad.asp?cat="
url = url + cat;
window.location.href< = url;
function sublist(inform, selecteditem)
inform.subcatagory.length = 0
<%
count= 0
y=0
do while not rs.eof
%>
inform.subcatagory.options[inform.subcatagory.length]=option <%=
trim(count)%>
<%
count = count + 1
y = y + 1
rs.movenext
loop
%>
</script>
<title></title>
</HEAD>
<BODY onLoad = "sublist(document.subad,document.subad.catagor y[document.subad.catagory.selectedIndex].value)">
<form name = subad action = "thankyouad.asp" >
<Table>
<tr>
<td height="24">First Name</td>
<td>Last Name</td>
</tr>x = <%= trim(y) %>
subcat = new Array();
subcatagorys = "<%= trim(rs("subcatagory"))%>"
subcatagoryof = "<%= trim(rs("subcat_of"))%>"
subcatagoryid = "<%= trim(rs("subcatagory_id"))%>"
subcat[x,0] = subcatagorys;
subcat[x,1] = subcatagoryof;
subcat[x,2] = subcatagoryid;
if (subcat[x,1] == selecteditem)
{
var option<%= trim(count) %> = new Option(subcat[x,0], subcat[x,2])
<tr>
<td ><Input NAME="NameFirst" size ="30" value=<%=fn%> ></td>
<td><Input NAME="NameLast" size ="40" value=<%=ln%>></td>
</tr>
<tr>
<td>Work Phone</td>
<td>Home Phone</td>
</tr>
<tr>
<td><Input NAME="workphone" MaxLength="15" value="<%=wp%>" ></td>
<td><Input NAME="homephone" MaxLength="15" value="<%=hp%>" ></td>
</tr>
<tr>
<td>Email</td>
</tr>
<tr>
<td><Input NAME="email" MaxLength="50" value=<%=em%>></td>
</tr>
</table>
<table>
<tr>
<td>Headline</td>
</tr>
<tr>
<td><Input Name = "headline" MaxLength = "100" value="" size=50></td>
</tr>
<tr>
<td>Description</td>
</tr>
<tr>
<td><textarea name = "description" rows = 5 cols = 50></textarea></td>
</tr>
<%
cat = Request.QueryString("cat")
sqlstring = "SELECT * from classfd_Catagory"
set rs = conn.execute (sqlstring)
%>
<tr>
<td>Catagory</td>
</tr>
<tr>
<td><SELECT id=catagory name=catagory onChange = "sublist(this.form,
document.subad.catagory[document.subad.catagory.selectedIndex].value)">
<OPTION selected value=""></OPTION>
<%
do until rs.eof
%>
<OPTION value="<%= rs("catagory_id")%>"><% = rs("catagory")%></OPTION>
<%
rs.movenext
loop
set rs = nothing
%>
</SELECT></td>
</tr>
<tr>
<td><SELECT id = "subcatagory" name="subcatagory">
<Option selected value="none">-------------------------</option>
</SELECT>
</td>
</tr>
<tr>
<td>Price</td>
<tr>
<tr>
<td><INPUT type="text" id=price name=price></td>
</tr>
<td><Input type=submit value = "Submit" id=submit1 name=submit1 ></td>
</tr>
</table >
</form>
</BODY>
</HTML>
<%
rs.Close()
Set rs = Nothing
%>
nathan Guest
-
Help with dependent drop down lists and datagrids
I'm trying to create two drop down boxes and a data grid wherethe content of the second drop down list depends on the intemselected in the first drop... -
Dependent Drop Down Lists
I want to have a form with several standard test boxes. I also want two drop down lists. The first list has options, based on the option that is... -
Assistance needed
i'm just trying to ge the effect of a flickering screen with interlaced lines. i have seen this done but can't remeber where any assistance will be... -
Assistance Needed...
COMPLETE NOVICE - SORRY... Greetings. I have a big problem with a flash file, I need to change the text displayed on mouse over / hit, But... -
Help requested - need setup assistance with D-Link DP-300 Print Server
Hi John, I guess this is a bit late, but I am just dealing with a D-link DP-300+ print server at the moment. Unfortuntely, I am doing everything... -
n4th4n@hushmail.com #2
Re: Help! Dependent Lists with SQL Server (with code/db setup) assistance needed!
Too much?
************************************************** ********************
Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
n4th4n@hushmail.com Guest
-
Ray at #3
Re: Help! Dependent Lists with SQL Server (with code/db setup) assistance needed!
Too much what? Impatience? Yes.
Ray at work
"nathan f" <n4th4n@hushmail.com> wrote in message
news:O1fHe5EsDHA.2444@TK2MSFTNGP12.phx.gbl...ASP.NET resources...> Too much?
>
> ************************************************** ********************
> Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
> Comprehensive, categorised, searchable collection of links to ASP &
Ray at Guest
-
Ray at #4
Re: Help! Dependent Lists with SQL Server (with code/db setup) assistance needed!
Too much what? Irrelevant HTML? Yes.
Ray at work
"nathan f" <n4th4n@hushmail.com> wrote in message
news:O1fHe5EsDHA.2444@TK2MSFTNGP12.phx.gbl...ASP.NET resources...> Too much?
>
> ************************************************** ********************
> Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
> Comprehensive, categorised, searchable collection of links to ASP &
Ray at Guest
-
Ray at #5
Re: Help! Dependent Lists with SQL Server (with code/db setup) assistance needed!
Too much what? Indication of what line is number 56? No.
Ray at work
"nathan f" <n4th4n@hushmail.com> wrote in message
news:O1fHe5EsDHA.2444@TK2MSFTNGP12.phx.gbl...ASP.NET resources...> Too much?
>
> ************************************************** ********************
> Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
> Comprehensive, categorised, searchable collection of links to ASP &
Ray at Guest
-
n4th4n@hushmail.com #6
Re: Help! Dependent Lists with SQL Server (with code/db setup) assistance needed!
Hey! Thanks for your trolling, I fixed it, you can go back under your bridge now. Thanks.
************************************************** ********************
Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
n4th4n@hushmail.com Guest



Reply With Quote

