Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Kenji Cell #1
Dynamic List Error
Hi ,
I have a page set up to allow changes to be made to a product. Alot of the
options for changing products have only a few possible choices of entry so to
allow ease of entry and to reduce possible errors I have set up list entries as
tables in my database. I am receiving an error message for a drop down list
that is dynamically populated by one of these tables:
Microsoft VBScript runtime error '800a005e' Invalid use of Null: 'CStr'
/test/index.asp, line 285
I have the dynamic list populated using values and labels from within the
database and getting dreamweaver to select the entry in the product table for
that particular product by default.
I have put the code to this page further down the page. I am guessing the
problem either stems from a missing value in the table for the dynamically
created list or one of the existing values within the product table is
different to one of the values in the list table. I have checked for both of
these problems and I can see neither problem occuring. If I just populate the
list on the page dynamically it works fine but as soon as I get dreamweaver to
automatically show the existing value for that particular product it shows this
error.
The table in the database for the dynamic list can be seen
[url]http://www.tube-shop.com/dynamiclist.gif[/url]
The page with the error in the Drop down list is
[url]http://www.tube-shop.com/test/index.asp[/url]
The same page without 'Select value equal to' entered is
[url]http://www.tube-shop.com/test/index2.asp[/url] - This page works.
The code for the page is attached, line 285 code is below:
<option value="<%=(rsMount.Fields.Item("ListSpMountValue") .Value)%>" <%If (Not
isNull((rsProd.Fields.Item("Mounting").Value))) Then If
(CStr(rsMount.Fields.Item("ListSpMountValue").Valu e) =
CStr((rsProd.Fields.Item("Mounting").Value))) Then
Response.Write("selected=""selected""") : Response.Write("")%>Hopefully someone can figure this out as I have played around with it for days><%=(rsMount.Fields.Item("ListSpMountLabel").Value )%></option>
now and cannot get it to work.
Thanks in advance
Kelly
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/conn_tubeshop_prod.asp" -->
<%
Dim rsshowhide
Dim rsshowhide_numRows
Set rsshowhide = Server.CreateObject("ADODB.Recordset")
rsshowhide.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsshowhide.Source = "SELECT * FROM product_hide"
rsshowhide.CursorType = 0
rsshowhide.CursorLocation = 2
rsshowhide.LockType = 1
rsshowhide.Open()
rsshowhide_numRows = 0
%>
<%
Dim rsProd__MMColParam
rsProd__MMColParam = "Spares"
If (Request("MM_EmptyValue") <> "") Then
rsProd__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim rsProd
Dim rsProd_numRows
Set rsProd = Server.CreateObject("ADODB.Recordset")
rsProd.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsProd.Source = "SELECT * FROM Product WHERE Categorys = '" +
Replace(rsProd__MMColParam, "'", "''") + "'"
rsProd.CursorType = 0
rsProd.CursorLocation = 2
rsProd.LockType = 1
rsProd.Open()
rsProd_numRows = 0
%>
<%
Dim rsTubeType
Dim rsTubeType_numRows
Set rsTubeType = Server.CreateObject("ADODB.Recordset")
rsTubeType.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsTubeType.Source = "SELECT * FROM ListSparesType"
rsTubeType.CursorType = 0
rsTubeType.CursorLocation = 2
rsTubeType.LockType = 1
rsTubeType.Open()
rsTubeType_numRows = 0
%>
<%
Dim rsSockettype
Dim rsSockettype_numRows
Set rsSockettype = Server.CreateObject("ADODB.Recordset")
rsSockettype.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsSockettype.Source = "SELECT * FROM ListSocketType ORDER BY ListSTLabel ASC"
rsSockettype.CursorType = 0
rsSockettype.CursorLocation = 2
rsSockettype.LockType = 1
rsSockettype.Open()
rsSockettype_numRows = 0
%>
<%
Dim rsIOStock
Dim rsIOStock_numRows
Set rsIOStock = Server.CreateObject("ADODB.Recordset")
rsIOStock.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsIOStock.Source = "SELECT * FROM ListInOutStock"
rsIOStock.CursorType = 0
rsIOStock.CursorLocation = 2
rsIOStock.LockType = 1
rsIOStock.Open()
rsIOStock_numRows = 0
%>
<%
Dim rsDeliveryTime
Dim rsDeliveryTime_numRows
Set rsDeliveryTime = Server.CreateObject("ADODB.Recordset")
rsDeliveryTime.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsDeliveryTime.Source = "SELECT * FROM ListDeliveryTime"
rsDeliveryTime.CursorType = 0
rsDeliveryTime.CursorLocation = 2
rsDeliveryTime.LockType = 1
rsDeliveryTime.Open()
rsDeliveryTime_numRows = 0
%>
<%
Dim rsMaterial
Dim rsMaterial_numRows
Set rsMaterial = Server.CreateObject("ADODB.Recordset")
rsMaterial.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsMaterial.Source = "SELECT * FROM ListSparesMaterial"
rsMaterial.CursorType = 0
rsMaterial.CursorLocation = 2
rsMaterial.LockType = 1
rsMaterial.Open()
rsMaterial_numRows = 0
%>
<%
Dim rsMount
Dim rsMount_numRows
Set rsMount = Server.CreateObject("ADODB.Recordset")
rsMount.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsMount.Source = "SELECT * FROM ListSparesMount"
rsMount.CursorType = 0
rsMount.CursorLocation = 2
rsMount.LockType = 1
rsMount.Open()
rsMount_numRows = 0
%>
<%
Dim rsFeature
Dim rsFeature_numRows
Set rsFeature = Server.CreateObject("ADODB.Recordset")
rsFeature.ActiveConnection = MM_conn_tubeshop_prod_STRING
rsFeature.Source = "SELECT * FROM ListSparesFeatures"
rsFeature.CursorType = 0
rsFeature.CursorLocation = 2
rsFeature.LockType = 1
rsFeature.Open()
rsFeature_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="robots" content="noindex">
<title>Tube-Shop.Com Administration</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="../styles/tubestyle.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {color: #EEEEEE}
-->
</style>
</head>
<body>
<table width="775" border="0" cellpadding="5">
<tr>
<td><img src="../images/design/adminheader.jpg" width="775" height="70"
/></td>
</tr>
<tr>
<td class="serviceheader"> </td>
</tr>
<tr>
<td class="accountheader"><form id="productedit" name="productedit">
<table width="95%" border="0" align="center" cellpadding="5">
<tr>
<td width="3%"> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td bgcolor="#EEEEEE"><a href="admin_admin.asp"><img
src="../images/design/arrow_grey.gif" width="7" height="10" border="0" /><br />
<span class="style2">1</span></a></td>
<td colspan="2" bgcolor="#EEEEEE"><a href="admin_prod_edit.asp"
target="_self">Edit Existing Product </a><a href="admin_prod_edit.asp"
target="_self"></a><a href="admin_prod_edit.asp" target="_self"><br />
</a><span class="DetailedDescription">View and edit an existing
product.</span></td>
</tr>
<tr>
<td> </td>
<td width="25%" class="cartminibold">Product Name: </td>
<td><div align="left">
<label>
<input name="productname" type="text" id="productname"
value="<%=(rsProd.Fields.Item("ProductName").Value )%>" size="30" />
</label>
</div></td>
</tr>
<tr>
<td> </td>
<td width="25%" class="cartminibold">Category: </td>
<td><div align="left">
<label></label>
<label></label>
<span
class="serviceheader"><%=(rsProd.Fields.Item("Cate gorys").Value)%></span></div><
/td>
</tr>
<tr>
<td> </td>
<td width="25%" class="cartminibold">UK Price: </td>
<td><div align="left">
<label></label>
<label><span class="serviceheader">£</span>
<input name="uk_price" type="text" id="uk_price" value="<%=
FormatNumber((rsProd.Fields.Item("UKPrice").Value) , 2, -2, -2, -2) %>"
size="10" />
</label>
</div></td>
</tr>
<tr>
<td> </td>
<td width="25%" class="cartminibold">USA Price: </td>
<td><div align="left">
<label class="serviceheader">$</label>
<input name="us_price" type="text" id="us_price" value="<%=
FormatNumber((rsProd.Fields.Item("USPrice").Value) , 2, -2, -2, -2) %>"
size="10" />
</div></td>
</tr>
<tr>
<td> </td>
<td width="25%" class="cartminibold">Euro Price: </td>
<td><div align="left">
<label><span class="serviceheader">€</span></label>
<input name="euro_price" type="text" id="euro_price" value="<%=
FormatNumber((rsProd.Fields.Item("EuroPrice").Valu e), 2, -2, -2, -2) %>"
size="10" />
</div></td>
</tr>
<tr>
<td> </td>
<td width="25%" class="cartminibold">Useage: </td>
<td><div align="left">
<label></label>
<label></label>
<label>
<select name="useage" id="useage">
<%
While (NOT rsTubeType.EOF)
%>
<option
value="<%=(rsTubeType.Fields.Item("ListSpTypeValue ").Value)%>" <%If (Not
isNull((rsProd.Fields.Item("TubeType").Value))) Then If
(CStr(rsTubeType.Fields.Item("ListSpTypeValue").Va lue) =
CStr((rsProd.Fields.Item("TubeType").Value))) Then
Response.Write("selected=""selected""") : Response.Write("")%><%><%=(rsTubeType.Fields.Item("ListSpTypeLabel").Val ue)%></option>
rsTubeType.MoveNext()
Wend
If (rsTubeType.CursorType > 0) Then
rsTubeType.MoveFirst
Else
rsTubeType.Requery
End If
%>
</
Kenji Cell Guest
-
<mx:List> Dynamic Height
Ok, I have a list. The list uses an itemRenderer that has dynamic content. The itemRenderers can be different heights from any range, and... -
dynamic list box help
Hi I have created a dynamic list box which has 5 items in there. when i click on an item on the list i want it to go to another page where it... -
Dynamic List Problem
Hi all, could someone please help me with a problem I've been trying to resolve for the last 4 hours? Basically, I have an ASP page, which... -
Dynamic list box
I have a form which collects a users contact details and adds them to a database (Access) table called 'Users' using ASP, on that form there is a... -
Dynamic ASP Drop Down List
Hi, I have created a drop down list which is linked to a dataset. Can anyone tell me how I can display 'Please Select' at the top of the drop down... -



Reply With Quote

