Hi Chopstick,
Ok I went through every page and all is good now in terms of the ordering.
And as a result of tidying everything up all the data in the text fields and drop down are fine, but the last two images out of three do not get uploaded to the server, in fact it deletes what ever is in those 2 fields.
I will post each page for you to see:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Server.ScriptTimeout = 360 %>
<%
' Get the Product ID
catID = Request( "pid" )
delID = Request( "pid" )
'initialise objects and variables
dim connU, strsqlU, rsuserU
'Set objCmd = Server.CreateObject("ADODB.Recordset")
set connU=server.createobject("ADODB.Connection")
set rsuserU=server.createobject("ADODB.Recordset")
strMDBpath = Server.MapPath("..\db_import\EventStyle.mdb")
'direct connection
connU.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & strMDBPath
rsuserU.ActiveConnection = connU
rsuserU.CursorType = 3
strsqlU = "SELECT * FROM eventDisplay WHERE cat_ID=" & catID
rsuserU.open strsqlU
IF NOT rsuserU.EOF THEN
artTitle = rsuserU( "art_Title" )
artCategory = rsuserU( "art_Category" )
artBriefDesc = rsuserU( "art_BDescription" )
artPrice = rsuserU( "art_Price" )
artPicFull = rsuserU( "art_ThumbFull" )
artFace = rsuserU( "art_ThumbFace" )
artHood = rsuserU( "art_ThumbHood" )
artCaseDesc = rsuserU( "case_Text" )
artDialDesc = rsuserU( "dial_Text" )
artMovementDesc = rsuserU( "movement_Text" )
artMakerDesc = rsuserU( "maker_Text" )
artDatDesc = rsuserU( "dat_Text" )
artHeightDesc = rsuserU( "height_Text" )
artStatus = rsuserU( "art_Status" )
artDisplay = rsuserU( "art_Display" )
artMoonDisplay = rsuserU( "art_MoonDisplay" )
END IF
rsuserU.Close
FUNCTION SELECTED( firstVal, secondVal )
IF cSTR( firstVal ) = cSTR( secondVal ) THEN
SELECTED = " SELECTED "
END IF
END FUNCTION
%>
<body bgcolor="White">
<form method="post" enctype="multipart/form-data" action="manageproducts_art.asp">
<center>
<table width="700" border="1" bgcolor="White" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2" bgcolor="yellow"><b>
Edit or Update Clock Information: </b>
</td>
</tr>
<tr>
<td><b>Title:</b>
</td>
<td><input name="artTitle" size="50" maxlength="50" value="<%=Server.HTMLEncode( artTitle )%>">
</td>
</tr>
<tr>
<td><b>Category:</b>
</td>
<td> <select name="artCategory">
<option value="Longcase Mahogany" <%=SELECTED( "Longcase Mahogany", artCategory )%>>Longcase Mahogany
<option value="Longcase Oak" <%=SELECTED( "Longcase Oak", artCategory )%>>Longcase Oak
<option value="Longcase Walnut" <%=SELECTED( "Longcase Walnut", artCategory )%>>Longcase Walnut
<option value="Longcase Marquetry" <%=SELECTED( "Longcase Marquetry", artCategory )%>>Longcase Marquetry
<option value="Longcase Lacquer" <%=SELECTED( "Longcase Lacquer", artCategory )%>>Longcase Lacquer
<option value="Longcase Miscellaneous" <%=SELECTED( "Longcase Miscellaneous", artCategory )%>>Longcase Miscellaneous
<option value="Other clocks and instruments" <%=SELECTED( "Other clocks and instruments", artCategory )%>>Other clocks and instruments
<option value="Barometers" <%=SELECTED( "Barometers", artCategory )%>>Barometers
<option value="Longcase Mahogany Archive" <%=SELECTED( "Longcase Mahogany Archive", artCategory )%>>Longcase Mahogany Archive
<option value="Longcase Oak Archive" <%=SELECTED( "Longcase Oak Archive", artCategory )%>>Longcase Oak Archive
<option value="Longcase Walnut Archive" <%=SELECTED( "Longcase Walnut Archive", artCategory )%>>Longcase Walnut Archive
<option value="Longcase Marquetry Archive" <%=SELECTED( "Longcase Marquetry Archive", artCategory )%>>Longcase Marquetry Archive
<option value="Longcase Lacquer Archive" <%=SELECTED( "Longcase Lacquer Archive", artCategory )%>>Longcase Lacquer Archive
<option value="Longcase Miscellaneous Archive" <%=SELECTED( "Longcase Miscellaneous Archive", artCategory )%>>Longcase Miscellaneous Archive
<option value="Other clocks and instruments Archive" <%=SELECTED( "Other clocks and instruments Archive", artCategory )%>>Other clocks and instruments Archive
<option value="Barometers Archive" <%=SELECTED( "Barometers Archive", artCategory )%>>Barometers Archive
</select></td>
</tr>
<tr>
<tr>
<td><b>Brief Description:</b>
</td>
<td><textarea name="artBriefDesc" cols="50" rows="5"><%=Server.HTMLEncode( artBriefDesc )%></textarea>
</td>
</tr>
<tr>
<tr>
<td><b>Price:</b>
</td>
<td><input name="artPrice" size="50" maxlength="50" value="<%=Server.HTMLEncode( artPrice )%>">
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><b>Current Full Length Clock Picture:</b> </td>
<td bgcolor="#CCCCCC"><%=Server.HTMLEncode(artPicFull)%> </td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><b>New Full Length Clock Picture:</b> </td>
<td bgcolor="#CCCCCC"><input name="artPicFull" size="50" type="file"></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><b>Current Clock Face Picture:</b> </td>
<td bgcolor="#CCCCCC"><%=Server.HTMLEncode(artFace)%> </td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><b>New Clock Face Picture:</b> </td>
<td bgcolor="#CCCCCC"><input name="artFace" size="50" type="file"></td>
</tr>
<tr>
<td><b>Current Clock Hood Picture:</b> </td>
<td><%=Server.HTMLEncode(artHood)%> </td>
</tr>
<tr>
<td><b>New Clock Hood Picture:</b> </td>
<td><input name="artHood" size="50" type="file"></td>
</tr>
<tr>
<td><b>Case Description:</b>
</td>
<td><textarea name="artCaseDesc" cols="50" rows="5"><%=Server.HTMLEncode( artCaseDesc )%></textarea>
</td>
</tr>
<tr>
<td><b>Dial Description:</b>
</td>
<td><textarea name="artDialDesc" cols="50" rows="5"><%=Server.HTMLEncode( artDialDesc )%></textarea>
</td>
</tr>
<tr>
<td><b>Movement Description:</b>
</td>
<td><textarea name="artMovementDesc" cols="50" rows="5"><%=Server.HTMLEncode( artMovementDesc )%></textarea>
</td>
</tr>
<tr>
<td><b>Maker Description:</b>
</td>
<td><textarea name="artMakerDesc" cols="50" rows="5"><%=Server.HTMLEncode( artMakerDesc )%></textarea>
</td>
</tr>
<tr>
<td><b>Date Description:</b>
</td>
<td><textarea name="artDatDesc" cols="50" rows="5"><%=Server.HTMLEncode( artDatDesc )%></textarea>
</td>
</tr>
<tr>
<td><b>Height Description:</b>
</td>
<td><textarea name="artHeightDesc" cols="50" rows="5"><%=Server.HTMLEncode( artHeightDesc )%></textarea>
</td>
</tr>
<tr>
<td><strong>Status:</strong></td>
<td><select name=artStatus id="select">
<option value="IN STOCK" <%=SELECTED( "IN STOCK", artStatus )%>>IN STOCK
<option value="SOLD" <%=SELECTED( "SOLD", artStatus )%>>SOLD
</select></td>
</tr>
<tr>
<td><strong>Display:</strong></td>
<td><select name=artDisplay id="select">
<option value="1" <%=SELECTED( "1", artDisplay )%>>YES
<option value="0" <%=SELECTED( "0", artDisplay )%>>NO
</select></td>
</tr>
<tr>
<td><strong>Moon Image Display:</strong></td>
<td><select name=artMoonDisplay id="select">
<option value="1" <%=SELECTED( "1", artMoonDisplay )%>>YES
<option value="0" <%=SELECTED( "0", artMoonDisplay )%>>NO
</select></td>
</tr>
<tr>
<tr>
<td><a href="../adminPage.asp">Back </a></td>
<td><div align="right">
<input type="hidden" name="origImage" value="<%=Server.HTMLEncode(artPicFull)%>" />
<input type="hidden" name="origFImage" value="<%=Server.HTMLEncode(artFace)%>" />
<input type="hidden" name="origHImage" value="<%=Server.HTMLEncode(artHood)%>" />
<input name="catID" type="hidden" value="<%=catID%>">
<input name="updateProduct" type="hidden" value="1">
<input name="submit" type="submit" value="Update Art">
</div></td>
</tr>
</table>
</center>
</form>
</body>
</html>
and this is the page that deals with the data:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #INCLUDE file="../checkpassword.asp" -->
<% Server.ScriptTimeout = 360 %>
<%
FUNCTION fixQuotes ( theString )
fixQuotes = REPLACE( theString, "'", "''" )
END FUNCTION
set connM = server.createobject("ADODB.Connection")
connM.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("..\db_import\EventStyle.mdb")
if instr(Trim(Request.ServerVariables("HTTP_REFERER")),"addproduct_art.asp") or instr(Trim(Request.ServerVariables("HTTP_REFERER")),"updateproduct_art.asp") then
Set Upload = Server.CreateObject("Persits.Upload")
theCount = upload.save(server.mappath("..")&"\images\uploaded")
dim arr(3), i
i = 1
For Each File in Upload.Files
arr(i) = File.FileName
i = i + 1
Next
'Count = Upload.SaveVirtual("../upload")
' Get the form variables
addProduct = TRIM (Upload.Form("addProduct"))
updateProduct = TRIM (Upload.Form("updateProduct"))
deleteProduct = TRIM (Upload.Form("deleteProduct"))
'response.write("delete=" & deleteProduct)
delID = TRIM (Upload.Form("delID"))
catID = TRIM (Upload.Form("catID"))
artTitle = TRIM (Upload.Form("artTitle"))
artCategory = TRIM (Upload.Form("artCategory"))
artBriefDesc = TRIM (Upload.Form("artBriefDesc"))
artPrice = TRIM (Upload.Form("artPrice"))
artPicFull = TRIM (arr(1))
artFace = TRIM (arr(2))
artHood = TRIM (arr(3))
artCaseDesc = TRIM (Upload.Form("artCaseDesc"))
artDialDesc = TRIM (Upload.Form("artDialDesc"))
artMovementDesc = TRIM (Upload.Form("artMovementDesc"))
artMakerDesc = TRIM (Upload.Form("artMakerDesc"))
artDatDesc = TRIM (Upload.Form("artDatDesc"))
artHeightDesc = TRIM (Upload.Form("artHeightDesc"))
artStatus = TRIM (Upload.Form("artStatus"))
artMoonDisplay = TRIM (Upload.Form("artMoonDisplay"))
artDisplay = TRIM (Upload.Form("artDisplay"))
origImage = TRIM(upload.Form("origImage"))
origFImage = TRIM(upload.Form("origFImage"))
origHImage = TRIM(upload.Form("origHImage"))
set upload = nothing
'response.write("CATID=" & catID)
'Assign Default Values
IF artTitle = "" THEN
artTitle = "?????"
END IF
IF artCategory = "" THEN
artCategory = "?????"
END IF
IF artBriefDesc = "" THEN
artBriefDesc = "?????"
END IF
IF artPrice = "" THEN
artPrice = "?????"
END IF
IF artCaseDesc = "" THEN
artCaseDesc = "?????"
END IF
IF artDialDesc = "" THEN
artDialDesc = "?????"
END IF
IF artMovementDesc = "" THEN
artMovementDesc = "?????"
END IF
IF artMakerDesc = "" THEN
artMakerDesc = "?????"
END IF
IF artDatDesc = "" THEN
artDatDesc = "?????"
END IF
IF artHeightDesc = "" THEN
artHeightDesc = "?????"
END IF
IF artStatus = "" THEN
artStatus = "?????"
END IF
IF artMoonDisplay = "" THEN
artMoonDisplay = "?????"
END IF
IF artDisplay = "" THEN
artDisplay = "?????"
END IF
' Add new product
if artPicFull = "" then
Pimage = origImage
else
Pimage = artPicFull
end if
if artHood = "" then
Fimage = origFImage
else
Fimage = artFace
end if
if artFace = "" then
Himage = origHImage
else
Himage = artHood
end if
if addProduct <> "" then
strsqlM = "INSERT INTO eventDisplay " &_
"( art_Title, art_Category, art_BDescription, art_Price, art_ThumbFull, art_ThumbFace, art_ThumbHood, case_Text, dial_Text, movement_Text, maker_Text, dat_Text, height_Text, art_Status, art_MoonDisplay, art_Display ) VALUES (" &_
" '" & fixQuotes (artTitle ) & "', " &_
" '" & fixQuotes (artCategory ) & "', " &_
" '" & fixQuotes (artBriefDesc ) & "', " &_
" '" & fixQuotes (artPrice ) & "', " &_
" '" & fixQuotes (artPicFull ) & "', " &_
" '" & fixQuotes (artFace ) & "', " &_
" '" & fixQuotes (artHood ) & "', " &_
" '" & fixQuotes (artCaseDesc ) & "', " &_
" '" & fixQuotes (artDialDesc ) & "', " &_
" '" & fixQuotes (artMovementDesc ) & "', " &_
" '" & fixQuotes (artMakerDesc ) & "', " &_
" '" & fixQuotes (artDatDesc ) & "', " &_
" '" & fixQuotes (artHeightDesc ) & "', " &_
" '" & fixQuotes (artStatus ) & "', " &_
" " & fixQuotes (artMoonDisplay ) & ", " &_
" " & fixQuotes (artDisplay ) & " )"
'rsuser.open strsql, conn
On Error Resume Next
ConnM.Execute strsqlM
If Err <> 0 Then
Response.Write "Error in query " & strsqlM
Response.End
End If
end if
%>
<style type="text/css">
<!--
.style2 {
color: #FF3400;
font-weight: bold;
}
-->
</style>
<center>
<br>
<table width="600" border="1" cellpadding="4"
cellspacing ="0" bgcolor="white">
<tr>
<td><strong>Clock Title:</strong></td>
<td><b><%=artTitle%></b> </td>
</tr>
<tr>
<td height="29"><strong>Category: </strong></td>
<td><b><%=artCategory%></b></td>
</tr>
<tr>
<td height="29"><strong>Brief Description:</strong></td>
<td><b><%=artBriefDesc%></b></td>
</tr>
<tr>
<td height="29"><strong>Price:</strong></td>
<td><b><%=artPrice%></b></td>
</tr>
<tr>
<td height="29"><strong>Picture of full length:</strong></td>
<td><b><%=Pimage%> </b></td>
</tr>
<tr>
<td height="29"><strong>Picture of the face:</strong></td>
<td><b><%=Fimage%> </b></td>
</tr>
<tr>
<td height="29"><strong>Picture of the hood:</strong></td>
<td><b><%=Himage%> </b></td>
</tr>
<tr>
<td height="29"><strong>Case Description:</strong></td>
<td><b><%=artCaseDesc%> </b></td>
</tr>
<tr>
<td height="29"><strong>Dial Description:</strong></td>
<td><b><%=artDialDesc%> </b></td>
</tr>
<tr>
<td height="29"><strong>Movement Description:</strong></td>
<td><b><%=artMovementDesc%> </b></td>
</tr>
<tr>
<td height="29"><strong>Maker Description:</strong></td>
<td><b><%=artMakerDesc%> </b></td>
</tr>
<tr>
<td height="29"><strong>Date Description:</strong></td>
<td><b><%=artDatDesc%> </b></td>
</tr>
<tr>
<td height="29"><strong>Height Description:</strong></td>
<td><b><%=artHeightDesc%> </b></td>
</tr>
<tr>
<td height="29"><strong>Status:</strong></td>
<td><br>
<b><%=artStatus%></b> </td>
</tr>
<tr>
<td height="29"><strong>Display:</strong></td>
<td><br>
<b><%=artDisplay%></b> </td>
</tr>
<tr>
<td height="29"><strong>Moon Display:</strong></td>
<td><b><%=artMoonDisplay%> </b></td>
</tr>
<tr>
<td height="29"> </td>
<td><br/><span class="style2">Was added to the database</span> </td>
</tr>
</table>
</center>
<p>
<%
end if
%>
<%
' Update Product
IF updateProduct <> "" THEN
if artPicFull = "" then
strsqlM = "UPDATE eventDisplay SET " &_
"art_Title='" & fixQuotes( artTitle ) & "', " &_
"art_Category='" & fixQuotes( artCategory ) & "', " &_
"art_BDescription='" & fixQuotes( artBriefDesc ) & "', " &_
"art_Price='" & fixQuotes( artPrice ) & "', " &_
"art_ThumbFace='" & fixQuotes( artFace ) & "', " &_
"art_ThumbHood='" & fixQuotes( artHood ) & "', " &_
"case_Text='" & fixQuotes(artCaseDesc ) & "', " &_
"dial_Text='" & fixQuotes(artDialDesc ) & "', " &_
"movement_Text='" & fixQuotes(artMovementDesc ) & "', " &_
"maker_Text='" & fixQuotes(artMakerDesc ) & "', " &_
"dat_Text='" & fixQuotes(artDatDesc ) & "', " &_
"height_Text='" & fixQuotes(artHeightDesc ) & "', " &_
"art_Status='" & fixQuotes( artStatus ) & "', " &_
"art_MoonDisplay=" & artMoonDisplay & ", " &_
"art_Display=" & artDisplay & " " &_
" WHERE " &_
"cat_ID=" & catID
else
strsqlM = "UPDATE eventDisplay SET " &_
"art_Title='" & fixQuotes( artTitle ) & "', " &_
"art_Category='" & fixQuotes( artCategory ) & "', " &_
"art_BDescription='" & fixQuotes( artBriefDesc ) & "', " &_
"art_Price='" & fixQuotes(artPrice ) & "', " &_
"art_ThumbFull='" & fixQuotes( artPicFull ) & "', " &_
"art_ThumbFace='" & fixQuotes( artFace ) & "', " &_
"art_ThumbHood='" & fixQuotes( artHood ) & "', " &_
"case_Text='" & fixQuotes(artCaseDesc ) & "', " &_
"dial_Text='" & fixQuotes(artDialDesc ) & "', " &_
"movement_Text='" & fixQuotes(artMovementDesc ) & "', " &_
"maker_Text='" & fixQuotes(artMakerDesc ) & "', " &_
"dat_Text='" & fixQuotes(artDatDesc ) & "', " &_
"height_Text='" & fixQuotes(artHeightDesc ) & "', " &_
"art_Status='" & fixQuotes( artStatus ) & "', " &_
"art_MoonDisplay=" & artMoonDisplay & ", " &_
"art_Display=" & artDisplay & " " &_
" WHERE " &_
"cat_ID=" & catID
end if
ConnM.Execute strsqlM
%>
<center>
<table width="600" cellpadding="4"
cellspacing="0" >
<tr>
<td>
<%=artTitle%> was updated in the database
<br/>
<br/>
</td>
</tr>
</table>
</center>
<%
END IF
%>
<center>
<table width="600" border="1" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2"><strong>
Edit Clock Information - </strong>If you want to edit information of a specific clock use the section below to select the Clock Title:</td>
</tr>
<tr>
<td align="center">
<table border="1" size="400" cellpadding="3" cellspacing="0">
<%
strsqlM = "SELECT cat_ID, art_Title FROM eventDisplay " &_
"ORDER BY art_Title"
set rs = server.createobject("adodb.recordset")
rs.activeconnection = ConnM
rs.open strsqlM
WHILE NOT rs.EOF
%>
<tr>
<td>
<a href="updateproduct_art.asp?pid=<%=rs( "cat_ID")%>"><%=rs( "art_Title" )%></a>
</td>
</tr>
<% rs.MoveNext
WEND
rs.close
set rs = nothing
ConnM.close
set ConnM = nothing
%>
</table>
</td>
</tr>
<tr>
<td>
<a href="../adminPage.asp"> Back </a>
</td>
</tr>
</table>
</center>