<% Timeout(1) set con = server.createobject("ADODB.Connection") con.open Application("CString") if UCase(Request.ServerVariables("REQUEST_METHOD")) = "POST" then i_CategoryID = Request("CategoryID") s_SubCategory = Request("SubCategory") strSQL = "SELECT * FROM L_Subcategories WHERE SubcategoryID = " & Request("id") set rsSubCat = server.createobject("ADODB.Recordset") rsSubCat.open strSQL, con, 1, 3 if not rsSubCat.EOF then rsSubCat.MoveFirst rsSubCat("CategoryID") = i_CategoryID rsSubCat("Name") = s_SubCategory rsSubCat.Update end if rsSubCat.close set rsSubCat = Nothing con.Close set con = Nothing Response.Redirect "subcategory.asp?intPage=" & Request("intPage") & "&buster=" & Server.URLEncode(Now()) end if strSQL = "SELECT CategoryID, [Name] FROM L_Categories ORDER BY [Name]" Set rsCategory = con.execute(strSQL) %> Website Administration <% if Request("id") <> Empty and IsNumeric(Request("id")) then strSQL = "SELECT CategoryID, [Name] FROM L_Subcategories WHERE SubcategoryID = " & Request("id") Set rsSubCat = con.execute(strSQL) if not rsSubCat.EOF then rsSubCat.MoveFirst i_CategoryID = CLng(rsSubCat("CategoryID")) s_SubCategory = rsSubCat("Name") %>

File / Document Library - Add a Sub-Category

<% if rsCategory.EOF then %>

There are no categories! Categories must exist first.

<% else %>

Category:

Sub-Category:

"> ">

<% end if %>
<% end if Set rsSubCat = Nothing end if %> <% Set rsCategory = Nothing con.Close set con = Nothing %>