Forums

ASP

This topic is locked

EDIT product but OPTION not showing all Categories

Posted 29 Jul 2007 22:53:47
1
has voted
29 Jul 2007 22:53:47 John Doo posted:
<font face='Arial'>Hi guys,&lt;br&gt;
Wonder if any one can help me out, I'm tearing my hair out, as they say!&lt;br&gt;&lt;br&gt;
I have Categories and various Products in each Category. I'm trying to build a page to EDIT/UPDATE each product. See &lt;a href="www.ollielaroo.net/pages/admin_products.asp"&gt;here&lt;/a&gt;.&lt;br&gt;
I want to be able to change the Category that a product belongs to, but all I get in the drop-down menu is the one specific Category. I have two recordsets on my edit_product.asp page: rsResults and rsCategories.
If anyone can help I would very much appreciate it <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Here is the code of 'edit_product.asp'

&lt;%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%&gt;
&lt;!--#include virtual="Connections/homes_connect.asp" --&gt;
&lt;%
Dim rsEditRecord__var_prodid
rsEditRecord__var_prodid = "1"
If (Request.QueryString("ID" &lt;&gt; "" Then
rsEditRecord__var_prodid = Request.QueryString("ID"
End If
%&gt;
&lt;%
Dim rsEditRecord
Dim rsEditRecord_numRows

Set rsEditRecord = Server.CreateObject("ADODB.Recordset"
rsEditRecord.ActiveConnection = MM_homes_connect_STRING
rsEditRecord.Source = "SELECT * FROM data WHERE ID = " + Replace(rsEditRecord__var_prodid, "'", "''" + ""
rsEditRecord.CursorType = 0
rsEditRecord.CursorLocation = 2
rsEditRecord.LockType = 1
rsEditRecord.Open()

rsEditRecord_numRows = 0
%&gt;
&lt;%
Dim rsCategories__var_prodid
rsCategories__var_prodid = "1"
If (Request.QueryString("ID" &lt;&gt; "" Then
rsCategories__var_prodid = Request.QueryString("ID"
End If
%&gt;
&lt;%
Dim rsCategories
Dim rsCategories_numRows

Set rsCategories = Server.CreateObject("ADODB.Recordset"
rsCategories.ActiveConnection = MM_homes_connect_STRING
rsCategories.Source = "SELECT * FROM data, cat WHERE ID = " + Replace(rsCategories__var_prodid, "'", "''" + " AND data.catid = cat.catid"
rsCategories.CursorType = 0
rsCategories.CursorLocation = 2
rsCategories.LockType = 1
rsCategories.Open()

rsCategories_numRows = 0
%&gt;

&lt;%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (Request.QueryString &lt;&gt; "" Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%&gt;
&lt;%
' *** Update Record: set variables

If (CStr(Request("MM_update") = "Edit" And CStr(Request("MM_recordId") &lt;&gt; "" Then

MM_editConnection = MM_homes_connect_STRING
MM_editTable = "data"
MM_editColumn = "ID"
MM_recordId = "" + Request.Form("MM_recordId" + ""
MM_editRedirectUrl = "confirm_edit_product.asp"
MM_fieldsStr = "name|value|catid|value|value|product_pic|value|brief_desc|value|full_desc|value|specs_title|value|specs|value|brochure1_name|value|brochure1_type|value|brochure1|value|brochure2_name|value|brochure2_type|value|brochure2|value|brochure3_name|value|brochure3_type|value|brochure3|value|pic_1|value|pic_2|value|pic_3|value"
MM_columnsStr = "name|',none,''|catid|',none,''|product_pic|',none,''|brief_desc|',none,''|full_desc|',none,''|specs_title|',none,''|specs|',none,''|brochure1_name|',none,''|brochure1_type|',none,''|brochure1|',none,''|brochure2_name|',none,''|brochure2_type|',none,''|brochure2|',none,''|brochure3_name|',none,''|brochure3_type|',none,''|brochure3|',none,''|pic_1|',none,''|pic_2|',none,''|pic_3|',none,''"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl &lt;&gt; "" And Request.QueryString &lt;&gt; "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString &lt;&gt; "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%&gt;
&lt;%
' *** Update Record: construct a sql update statement and execute it

If (CStr(Request("MM_update") &lt;&gt; "" And CStr(Request("MM_recordId") &lt;&gt; "" Then

' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" Then MM_emptyVal = ""
If (MM_formVal = "" Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal &lt;&gt; "" Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'" Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''" & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i &lt;&gt; LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl &lt;&gt; "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Edit Product &lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;style type="text/css"&gt;
&lt;!--
.style1 {font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color: #000066;
}
.style3 {color: #000000}
.style4 {color: #000066; font-family: Arial, Helvetica, sans-serif;}
.style5 {font-family: Arial, Helvetica, sans-serif}
--&gt;
&lt;/style&gt;
&lt;link href="/style.css" rel="stylesheet" type="text/css"&gt;
&lt;style&gt;
&lt;!--
/*Website Abstraction www.wsabstract.com More scripts here*/
a{text-decoration:none}
//--&gt;
&lt;/style&gt;
&lt;/head&gt;

&lt;body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"&gt;
&lt;div align="center"&gt;
&lt;form ACTION="&lt;%=MM_editAction%&gt;" METHOD="post" name="Edit" id="Edit"&gt;
&lt;div align="left"&gt;
&lt;table width="802" border="0" cellpadding="2" cellspacing="2" bgcolor="#F5FDFE" align="center"&gt;
&lt;!--DWLayoutTable--&gt;
&lt;tr&gt;
&lt;td height="43" colspan="5" valign="top" bgcolor="#000066"&gt;&lt;div align="left"&gt;&lt;strong&gt;&lt;font color="#FFFFFF" face="Arial, Helvetica, sans-serif"&gt;&nbsp;&nbsp;&nbsp;ID:&nbsp;&nbsp;
&lt;%=(rsEditRecord.Fields.Item("ID".Value)%&gt; &lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="4" valign="top" bgcolor="#000066"&gt; &lt;div align="center"&gt;&lt;font color="#FFFFFF" size="5" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;EDIT
PRODUCT&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="6" valign="top" bgcolor="#000066"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="1" height="17"&gt;&lt;/td&gt;
&lt;td width="4"&gt;&lt;/td&gt;
&lt;td width="104"&gt;&lt;/td&gt;
&lt;td width="13"&gt;&lt;/td&gt;
&lt;td width="131"&gt;&lt;/td&gt;
&lt;td width="114"&gt;&lt;/td&gt;
&lt;td width="2"&gt;&lt;/td&gt;
&lt;td width="91"&gt;&lt;/td&gt;
&lt;td width="8"&gt;&lt;/td&gt;
&lt;td width="2"&gt;&lt;/td&gt;
&lt;td width="50"&gt;&lt;/td&gt;
&lt;td width="8"&gt;&lt;/td&gt;
&lt;td width="89"&gt;&lt;/td&gt;
&lt;td width="10"&gt;&lt;/td&gt;
&lt;td width="83"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td rowspan="33" valign="top"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td height="12"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="23" colspan="2" valign="top" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Product
Name&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" rowspan="2" valign="top" class="Edit-Delete-FORM"&gt;&lt;div align="left"&gt;&lt;font face="Arial, Helvetica, sans-serif"&gt;&lt;/font&gt;
&lt;input name="name" type="text" id="name" value="&lt;%=(rsEditRecord.Fields.Item("name".Value)%&gt;" size="30"&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="2" rowspan="2" valign="top" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Product
Category&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="7" rowspan="2" valign="top"&gt; &lt;select name="catid" id="catid"&gt;
&lt;%
While (NOT rsCategories.EOF)
%&gt;
&lt;%
rsCategories.MoveNext()
Wend
If (rsCategories.CursorType &gt; 0) Then
rsCategories.MoveFirst
Else
rsCategories.Requery
End If
%&gt;
&lt;%
While (NOT rsCategories.EOF)
%&gt;
&lt;option value="&lt;%=(rsCategories.Fields.Item("category".Value)%&gt;" &lt;%If (Not isNull((rsCategories.Fields.Item("category".Value))) Then If (CStr(rsCategories.Fields.Item("category".Value) = CStr((rsCategories.Fields.Item("category".Value))) Then Response.Write("SELECTED" : Response.Write("1"%&gt; &gt;&lt;%=(rsCategories.Fields.Item("category".Value)%&gt;&lt;/option&gt;
&lt;%
rsCategories.MoveNext()
Wend
If (rsCategories.CursorType &gt; 0) Then
rsCategories.MoveFirst
Else
rsCategories.Requery
End If
%&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="3"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;td colspan="2" rowspan="4" valign="top"&gt;&lt;img src="/&lt;%=(rsEditRecord.Fields.Item("product_pic".Value)%&gt;" alt="" width="100" height="80" align="middle"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="45" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&lt;br&gt;
Product Picture&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="8" rowspan="2" valign="top"&gt;&lt;p align="left"&gt;&lt;font color="#000000" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&lt;font color="#000000" face="Arial, Helvetica, sans-serif"&gt;
&lt;input name="product_pic" type="text" id="product_pic" value="&lt;%=(rsEditRecord.Fields.Item("product_pic".Value)%&gt;" size="60"&gt;
&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;strong&gt;&lt;font color="#000000" face="Arial, Helvetica, sans-serif"&gt;
&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="18"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="14"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td colspan="10" rowspan="2" valign="top"&gt;&lt;p align="left" class="FormElement"&gt;
&lt;textarea name="brief_desc" cols="60" rows="2" id="brief_desc"&gt;&lt;%=(rsEditRecord.Fields.Item("brief_desc".Value)%&gt;&lt;/textarea&gt;
&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="79" colspan="2" valign="top" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brief
Description&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td colspan="10" rowspan="3" valign="top" bgcolor="#F5FDFE"&gt; &lt;p align="left" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;/font&gt;
&lt;textarea name="full_desc" cols="70" rows="12" id="full_desc"&gt;&lt;%=(rsEditRecord.Fields.Item("full_desc".Value)%&gt;&lt;/textarea&gt;
&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="78" colspan="2" valign="top" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Full
Description&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="143"&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="30" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Specs
Title&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;input name="specs_title" type="text" id="specs_title" value="&lt;%= rsEditRecord.Fields.Item("specs_title".Value %&gt;" size="50"&gt;
&lt;font size="2"&gt;&nbsp;Custom heading&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="138" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Specifications&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;textarea name="specs" cols="50" rows="7" id="specs"&gt;&lt;%= rsEditRecord.Fields.Item("specs".Value %&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="37" colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
1 Name&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;input name="brochure1_name" type="text" id="brochure1_name" value="&lt;%= rsEditRecord.Fields.Item("brochure1_name".Value %&gt;" size="30"&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
1 Type&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;select name="brochure1_type" id="brochure1_type"&gt;
&lt;option value="empty.jpg" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure1_type".Value))) Then If ("empty.jpg" = CStr((rsEditRecord.Fields.Item("brochure1_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;NONE
&lt;/option&gt;
&lt;option value="images/SITE/pdf.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure1_type".Value))) Then If ("images/SITE/pdf.gif" = CStr((rsEditRecord.Fields.Item("brochure1_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Adobe.pdf
&lt;/option&gt;
&lt;option value="images/SITE/word.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure1_type".Value))) Then If ("images/SITE/word.gif" = CStr((rsEditRecord.Fields.Item("brochure1_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Word.doc
&lt;/option&gt;
&lt;option value="images/SITE/excel.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure1_type".Value))) Then If ("images/SITE/excel.gif" = CStr((rsEditRecord.Fields.Item("brochure1_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Excel.xls
&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="37" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
1 File&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;input name="brochure1" type="text" id="brochure1" value="&lt;%= rsEditRecord.Fields.Item("brochure1".Value %&gt;" size="80"&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="37" colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
2 Name&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;input name="brochure2_name" type="text" id="brochure2_name" value="&lt;%= rsEditRecord.Fields.Item("brochure2_name".Value %&gt;" size="30"&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
2 Type&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;select name="brochure2_type" id="select3"&gt;
&lt;option value="empty.jpg" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure2_type".Value))) Then If ("empty.jpg" = CStr((rsEditRecord.Fields.Item("brochure2_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;NONE
&lt;/option&gt;
&lt;option value="images/SITE/pdf.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure2_type".Value))) Then If ("images/SITE/pdf.gif" = CStr((rsEditRecord.Fields.Item("brochure2_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Adobe.pdf
&lt;/option&gt;
&lt;option value="images/SITE/word.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure2_type".Value))) Then If ("images/SITE/word.gif" = CStr((rsEditRecord.Fields.Item("brochure2_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Word.doc
&lt;/option&gt;
&lt;option value="images/SITE/excel.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure2_type".Value))) Then If ("images/SITE/excel.gif" = CStr((rsEditRecord.Fields.Item("brochure2_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Excel.xls
&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="36" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
2 File&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;input name="brochure2" type="text" id="brochure2" value="&lt;%= rsEditRecord.Fields.Item("brochure2".Value %&gt;" size="80"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="37" colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
3 Name&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;input name="brochure3_name" type="text" id="brochure3_name" value="&lt;%= rsEditRecord.Fields.Item("brochure3_name".Value %&gt;" size="30"&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
3 Type&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;select name="brochure3_type" id="select4"&gt;
&lt;option value="empty.jpg" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure3_type".Value))) Then If ("empty.jpg" = CStr((rsEditRecord.Fields.Item("brochure3_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;NONE
&lt;/option&gt;
&lt;option value="images/SITE/pdf.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure3_type".Value))) Then If ("images/SITE/pdf.gif" = CStr((rsEditRecord.Fields.Item("brochure3_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Adobe.pdf
&lt;/option&gt;
&lt;option value="images/SITE/word.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure3_type".Value))) Then If ("images/SITE/word.gif" = CStr((rsEditRecord.Fields.Item("brochure3_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Word.doc
&lt;/option&gt;
&lt;option value="images/SITE/excel.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure3_type".Value))) Then If ("images/SITE/excel.gif" = CStr((rsEditRecord.Fields.Item("brochure3_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Excel.xls
&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="36" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
3 File&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;input name="brochure3" type="text" id="brochure3" value="&lt;%= rsEditRecord.Fields.Item("brochure3".Value %&gt;" size="80"&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="5"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="9"&gt;&lt;/td&gt;
&lt;td rowspan="2" valign="top" class="Edit-Delete-FORM"&gt; &lt;p align="left"&gt;&lt;font color="#000033" size="2"&gt;Detail
Pic 1&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="27"&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;input name="pic_1" type="text" id="pic_1" value="&lt;%=(rsEditRecord.Fields.Item("pic_1".Value)%&gt;" size="70"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="96" colspan="2" valign="top"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;p&gt;&lt;img src="/&lt;%=(rsEditRecord.Fields.Item("pic_1".Value)%&gt;" alt="" align="left"&gt;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="10"&gt;&lt;/td&gt;
&lt;td rowspan="2" valign="top"&gt; &lt;p align="left"&gt;&lt;font color="#000033" size="2"&gt;&lt;strong&gt;Detail
Pic 2&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="26"&gt;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;input name="pic_2" type="text" id="pic_22" value="&lt;%=(rsEditRecord.Fields.Item("pic_2".Value)%&gt;" size="70"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="86" colspan="2" valign="top"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;p&gt;&lt;img src="/&lt;%=(rsEditRecord.Fields.Item("pic_2".Value)%&gt;" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;td rowspan="2" valign="top" bgcolor="#F5FDFE"&gt; &lt;p align="left"&gt;&lt;font color="#000066" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&nbsp;&lt;/strong&gt;&lt;/font&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Detail
Pic 3&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="42"&gt;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;font color="#000066" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&lt;font color="#000000"&gt;
&lt;input name="pic_3" type="text" id="pic_32" value="&lt;%=(rsEditRecord.Fields.Item("pic_3".Value)%&gt;" size="70"&gt;
&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="49" colspan="2" valign="top"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="10" valign="top"&gt;&lt;img src="/&lt;%=(rsEditRecord.Fields.Item("pic_3".Value)%&gt;" alt=""&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="64" colspan="14" valign="top"&gt; &lt;div align="center"&gt;
&lt;p&gt; &lt;br&gt;
&lt;input type="submit" name="Submit" value="Edit Product"&gt;
&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;input type="hidden" name="MM_update" value="Edit"&gt;
&lt;input type="hidden" name="MM_recordId" value="&lt;%= rsEditRecord.Fields.Item("ID".Value %&gt;"&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;p align="center" class="style1"&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;font color="#000066" size="3" face="Arial, Helvetica, sans-serif"&gt;&lt;&lt;
BACK&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsEditRecord.Close()
Set rsEditRecord = Nothing
%&gt;
&lt;%
rsCategories.Close()
Set rsCategories = Nothing
%&gt;


</font id='Arial'>

Thanks in advance for any help.
John

Replies

Replied 30 Jul 2007 23:35:50
30 Jul 2007 23:35:50 John Doo replied:
OK here I go again.

PRODUCTS TABLE is still called 'data' ID is the PK
CATEGORIES TABLE is still called 'cat' catid is the FK

This time I think I should be using just one recordset 'rsEditRecord' right?
...trying to update the value for the product 'ID'.

www.ollielaroo.net/pages/admin_products.asp

My code is now different obviously, but still, where I want to have the CATEGORIES dropdown menu, to edit the Category, I get this famous error:

"Item cannot be found in the collection corresponding to the requested name or ordinal, /edit_product.asp line 232"

Here is my code:
------------------------------------------------------------------------------------

&lt;%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%&gt;
&lt;!--#include virtual="Connections/homes_connect.asp" --&gt;
&lt;%
Dim rsEditRecord__var_prodid
rsEditRecord__var_prodid = "1"
If (Request.QueryString("ID" &lt;&gt; "" Then
rsEditRecord__var_prodid = Request.QueryString("ID"
End If
%&gt;
&lt;%
Dim rsEditRecord
Dim rsEditRecord_numRows

Set rsEditRecord = Server.CreateObject("ADODB.Recordset"
rsEditRecord.ActiveConnection = MM_homes_connect_STRING
rsEditRecord.Source = "SELECT * FROM data, cat WHERE ID = " + Replace(rsEditRecord__var_prodid, "'", "''" + " AND data.catid = cat.catid"
rsEditRecord.CursorType = 0
rsEditRecord.CursorLocation = 2
rsEditRecord.LockType = 1
rsEditRecord.Open()

rsEditRecord_numRows = 0
%&gt;
&lt;%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (Request.QueryString &lt;&gt; "" Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%&gt;
&lt;%
' *** Update Record: set variables

If (CStr(Request("MM_update") = "Edit" And CStr(Request("MM_recordId") &lt;&gt; "" Then

MM_editConnection = MM_homes_connect_STRING
MM_editTable = "data"
MM_editColumn = "ID"
MM_recordId = "" + Request.Form("MM_recordId" + ""
MM_editRedirectUrl = "confirm_edit_product.asp"
MM_fieldsStr = "name|value|catid|value|product_pic|value|brief_desc|value|full_desc|value|specs_title|value|specs|value|brochure1_name|value|brochure1_type|value|brochure1|value|brochure2_name|value|brochure2_type|value|brochure2|value|brochure3_name|value|brochure3_type|value|brochure3|value|pic_1|value|pic_2|value|pic_3|value"
MM_columnsStr = "name|',none,''|catid|',none,''|product_pic|',none,''|brief_desc|',none,''|full_desc|',none,''|specs_title|',none,''|specs|',none,''|brochure1_name|',none,''|brochure1_type|',none,''|brochure1|',none,''|brochure2_name|',none,''|brochure2_type|',none,''|brochure2|',none,''|brochure3_name|',none,''|brochure3_type|',none,''|brochure3|',none,''|pic_1|',none,''|pic_2|',none,''|pic_3|',none,''"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl &lt;&gt; "" And Request.QueryString &lt;&gt; "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString &lt;&gt; "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%&gt;
&lt;%
' *** Update Record: construct a sql update statement and execute it

If (CStr(Request("MM_update") &lt;&gt; "" And CStr(Request("MM_recordId") &lt;&gt; "" Then

' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" Then MM_emptyVal = ""
If (MM_formVal = "" Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal &lt;&gt; "" Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'" Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''" & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i &lt;&gt; LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl &lt;&gt; "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Edit Product &lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;style type="text/css"&gt;
&lt;!--
.style1 {font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color: #000066;
}
.style3 {color: #000000}
.style4 {color: #000066; font-family: Arial, Helvetica, sans-serif;}
.style5 {font-family: Arial, Helvetica, sans-serif}
--&gt;
&lt;/style&gt;
&lt;link href="/style.css" rel="stylesheet" type="text/css"&gt;
&lt;style&gt;
&lt;!--
/*Website Abstraction www.wsabstract.com More scripts here*/
a{text-decoration:none}
//--&gt;
&lt;/style&gt;
&lt;/head&gt;

&lt;body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"&gt;
&lt;div align="center"&gt;
&lt;form ACTION="&lt;%=MM_editAction%&gt;" METHOD="post" name="Edit" id="Edit"&gt;
&lt;div align="left"&gt;
&lt;table width="795" border="0" cellpadding="2" cellspacing="2" bgcolor="#F5FDFE" align="center"&gt;
&lt;!--DWLayoutTable--&gt;
&lt;tr&gt;
&lt;td height="43" colspan="5" valign="top" bgcolor="#000066"&gt;&lt;div align="left"&gt;&lt;strong&gt;&lt;font color="#FFFFFF" face="Arial, Helvetica, sans-serif"&gt;&nbsp;&nbsp;&nbsp;ID:&nbsp;&nbsp;
&lt;%=(rsEditRecord.Fields.Item("ID".Value)%&gt; &lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="4" valign="top" bgcolor="#000066"&gt; &lt;div align="center"&gt;&lt;font color="#FFFFFF" size="5" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;EDIT
PRODUCT&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top" bgcolor="#000066"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="1" height="17"&gt;&lt;/td&gt;
&lt;td width="3"&gt;&lt;/td&gt;
&lt;td width="90"&gt;&lt;/td&gt;
&lt;td width="8"&gt;&lt;/td&gt;
&lt;td width="119"&gt;&lt;/td&gt;
&lt;td width="103"&gt;&lt;/td&gt;
&lt;td width="2"&gt;&lt;/td&gt;
&lt;td width="114"&gt;&lt;/td&gt;
&lt;td width="6"&gt;&lt;/td&gt;
&lt;td width="2"&gt;&lt;/td&gt;
&lt;td width="207"&gt;&lt;/td&gt;
&lt;td width="66"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td rowspan="33" valign="top"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td height="12"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="23" colspan="2" valign="top" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Product
Name&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" rowspan="2" valign="top" class="Edit-Delete-FORM"&gt;&lt;div align="left"&gt;&lt;font face="Arial, Helvetica, sans-serif"&gt;&lt;/font&gt;
&lt;input name="name" type="text" id="name" value="&lt;%=(rsEditRecord.Fields.Item("name".Value)%&gt;" size="30"&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="2" rowspan="2" valign="top" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Product
Category&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="4" rowspan="2" valign="top"&gt; &lt;select name="catid" id="catid"&gt;
&lt;%
While (NOT rsEditRecord.EOF)
%&gt;
&lt;%
rsEditRecord.MoveNext()
Wend
If (rsEditRecord.CursorType &gt; 0) Then
rsEditRecord.MoveFirst
Else
rsEditRecord.Requery
End If
%&gt;
&lt;%
While (NOT rsEditRecord.EOF)
%&gt;
&lt;option value="&lt;%=(rsEditRecord.Fields.Item("catid".Value)%&gt;" &lt;%If (Not isNull((rsEditRecord.Fields.Item("catid".Value))) Then If (CStr(rsEditRecord.Fields.Item("catid".Value) = CStr((rsEditRecord.Fields.Item("catid".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt; &gt;&lt;%=(rsEditRecord.Fields.Item("catid".Value)%&gt;&lt;/option&gt;
&lt;%
rsEditRecord.MoveNext()
Wend
If (rsEditRecord.CursorType &gt; 0) Then
rsEditRecord.MoveFirst
Else
rsEditRecord.Requery
End If
%&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="3"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="45" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&lt;br&gt;
Product Picture&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="7" rowspan="2" valign="top"&gt;&lt;p align="left"&gt;&lt;font color="#000000" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&lt;font color="#000000" face="Arial, Helvetica, sans-serif"&gt;
&lt;input name="product_pic" type="text" id="product_pic" value="&lt;%=(rsEditRecord.Fields.Item("product_pic".Value)%&gt;" size="60"&gt;
&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;strong&gt;&lt;font color="#000000" face="Arial, Helvetica, sans-serif"&gt;
&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td rowspan="3" valign="top"&gt;&lt;img src="/&lt;%=(rsEditRecord.Fields.Item("product_pic".Value)%&gt;" alt="" width="100" height="80" align="middle"&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="18"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="14"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;td colspan="8" rowspan="2" valign="top"&gt;&lt;p align="left" class="FormElement"&gt;
&lt;textarea name="brief_desc" cols="60" rows="2" id="brief_desc"&gt;&lt;%=(rsEditRecord.Fields.Item("brief_desc".Value)%&gt;&lt;/textarea&gt;
&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="79" colspan="2" valign="top" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brief
Description&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;td colspan="8" rowspan="3" valign="top" bgcolor="#F5FDFE"&gt; &lt;p align="left" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;/font&gt;
&lt;textarea name="full_desc" cols="70" rows="12" id="full_desc"&gt;&lt;%=(rsEditRecord.Fields.Item("full_desc".Value)%&gt;&lt;/textarea&gt;
&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="78" colspan="2" valign="top" class="FormElement"&gt;&lt;font color="#000033" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Full
Description&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="143"&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="30" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Specs
Title&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;input name="specs_title" type="text" id="specs_title" value="&lt;%= rsEditRecord.Fields.Item("specs_title".Value %&gt;" size="50"&gt;
&lt;font size="2"&gt;&nbsp;Custom heading&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="138" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Specifications&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;textarea name="specs" cols="50" rows="7" id="specs"&gt;&lt;%= rsEditRecord.Fields.Item("specs".Value %&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="37" colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
1 Name&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;input name="brochure1_name" type="text" id="brochure1_name" value="&lt;%= rsEditRecord.Fields.Item("brochure1_name".Value %&gt;" size="30"&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
1 Type&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="top"&gt;&lt;select name="brochure1_type" id="brochure1_type"&gt;
&lt;option value="empty.jpg" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure1_type".Value))) Then If ("empty.jpg" = CStr((rsEditRecord.Fields.Item("brochure1_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;NONE
&lt;/option&gt;
&lt;option value="images/SITE/pdf.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure1_type".Value))) Then If ("images/SITE/pdf.gif" = CStr((rsEditRecord.Fields.Item("brochure1_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Adobe.pdf
&lt;/option&gt;
&lt;option value="images/SITE/word.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure1_type".Value))) Then If ("images/SITE/word.gif" = CStr((rsEditRecord.Fields.Item("brochure1_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Word.doc
&lt;/option&gt;
&lt;option value="images/SITE/excel.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure1_type".Value))) Then If ("images/SITE/excel.gif" = CStr((rsEditRecord.Fields.Item("brochure1_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Excel.xls
&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="37" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
1 File&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;input name="brochure1" type="text" id="brochure1" value="&lt;%= rsEditRecord.Fields.Item("brochure1".Value %&gt;" size="80"&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="37" colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
2 Name&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;input name="brochure2_name" type="text" id="brochure2_name" value="&lt;%= rsEditRecord.Fields.Item("brochure2_name".Value %&gt;" size="30"&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
2 Type&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="top"&gt;&lt;select name="brochure2_type" id="select3"&gt;
&lt;option value="empty.jpg" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure2_type".Value))) Then If ("empty.jpg" = CStr((rsEditRecord.Fields.Item("brochure2_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;NONE
&lt;/option&gt;
&lt;option value="images/SITE/pdf.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure2_type".Value))) Then If ("images/SITE/pdf.gif" = CStr((rsEditRecord.Fields.Item("brochure2_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Adobe.pdf
&lt;/option&gt;
&lt;option value="images/SITE/word.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure2_type".Value))) Then If ("images/SITE/word.gif" = CStr((rsEditRecord.Fields.Item("brochure2_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Word.doc
&lt;/option&gt;
&lt;option value="images/SITE/excel.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure2_type".Value))) Then If ("images/SITE/excel.gif" = CStr((rsEditRecord.Fields.Item("brochure2_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Excel.xls
&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="36" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
2 File&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;input name="brochure2" type="text" id="brochure2" value="&lt;%= rsEditRecord.Fields.Item("brochure2".Value %&gt;" size="80"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="37" colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
3 Name&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;input name="brochure3_name" type="text" id="brochure3_name" value="&lt;%= rsEditRecord.Fields.Item("brochure3_name".Value %&gt;" size="30"&gt;&lt;/td&gt;
&lt;td colspan="3" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
3 Type&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="top"&gt;&lt;select name="brochure3_type" id="select4"&gt;
&lt;option value="empty.jpg" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure3_type".Value))) Then If ("empty.jpg" = CStr((rsEditRecord.Fields.Item("brochure3_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;NONE
&lt;/option&gt;
&lt;option value="images/SITE/pdf.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure3_type".Value))) Then If ("images/SITE/pdf.gif" = CStr((rsEditRecord.Fields.Item("brochure3_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Adobe.pdf
&lt;/option&gt;
&lt;option value="images/SITE/word.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure3_type".Value))) Then If ("images/SITE/word.gif" = CStr((rsEditRecord.Fields.Item("brochure3_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Word.doc
&lt;/option&gt;
&lt;option value="images/SITE/excel.gif" &lt;%If (Not isNull((rsEditRecord.Fields.Item("brochure3_type".Value))) Then If ("images/SITE/excel.gif" = CStr((rsEditRecord.Fields.Item("brochure3_type".Value))) Then Response.Write("SELECTED" : Response.Write(""%&gt;&gt;Excel.xls
&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="36" colspan="2" valign="top"&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Brochure
3 File&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;input name="brochure3" type="text" id="brochure3" value="&lt;%= rsEditRecord.Fields.Item("brochure3".Value %&gt;" size="80"&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="5"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="9"&gt;&lt;/td&gt;
&lt;td rowspan="2" valign="top" class="Edit-Delete-FORM"&gt; &lt;p align="left"&gt;&lt;font color="#000033" size="2"&gt;Detail
Pic 1&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="27"&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;input name="pic_1" type="text" id="pic_1" value="&lt;%=(rsEditRecord.Fields.Item("pic_1".Value)%&gt;" size="70"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="96" colspan="2" valign="top"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;p&gt;&lt;img src="/&lt;%=(rsEditRecord.Fields.Item("pic_1".Value)%&gt;" alt="" align="left"&gt;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="10"&gt;&lt;/td&gt;
&lt;td rowspan="2" valign="top"&gt; &lt;p align="left"&gt;&lt;font color="#000033" size="2"&gt;&lt;strong&gt;Detail
Pic 2&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="26"&gt;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;input name="pic_2" type="text" id="pic_22" value="&lt;%=(rsEditRecord.Fields.Item("pic_2".Value)%&gt;" size="70"&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="86" colspan="2" valign="top"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;p&gt;&lt;img src="/&lt;%=(rsEditRecord.Fields.Item("pic_2".Value)%&gt;" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="11"&gt;&lt;/td&gt;
&lt;td rowspan="2" valign="top" bgcolor="#F5FDFE"&gt; &lt;p align="left"&gt;&lt;font color="#000066" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&nbsp;&lt;/strong&gt;&lt;/font&gt;&lt;font color="#000033" size="2" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Detail
Pic 3&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="42"&gt;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;font color="#000066" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&lt;font color="#000000"&gt;
&lt;input name="pic_3" type="text" id="pic_32" value="&lt;%=(rsEditRecord.Fields.Item("pic_3".Value)%&gt;" size="70"&gt;
&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="49" colspan="2" valign="top"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="8" valign="top"&gt;&lt;img src="/&lt;%=(rsEditRecord.Fields.Item("pic_3".Value)%&gt;" alt=""&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="64" colspan="11" valign="top"&gt; &lt;div align="center"&gt;
&lt;p&gt; &lt;br&gt;
&lt;input type="submit" name="Submit" value="Edit Product"&gt;
&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;input type="hidden" name="MM_update" value="Edit"&gt;
&lt;input type="hidden" name="MM_recordId" value="&lt;%= rsEditRecord.Fields.Item("ID".Value %&gt;"&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;p align="center" class="style1"&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;font color="#000066" size="3" face="Arial, Helvetica, sans-serif"&gt;&lt;&lt;
BACK&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsEditRecord.Close()
Set rsEditRecord = Nothing
%&gt;
------------------------------------------------------------------------------------

Please somebody take out of this den of inequity!! <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>



Reply to this topic