<% dim conn dim ConStr dim sql dim rs dim expirydate dim startdate if request.QueryString("edit") = "true" then ConStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&server.MapPath("items.mdb") set conn = Server.CreateObject("ADODB.Connection") set rs = Server.CreateObject("ADODB.RecordSet") conn.open ConStr sql = "SELECT * FROM Content WHERE ID = '"&Request.QueryString("ID")&"'" rs.Open sql, conn rs.MoveFirst startdate = datepart("m",rs("StartDate"))&"/"&datepart("d",rs("StartDate"))&"/"&datepart("yyyy",rs("StartDate")) Expirydate = datepart("m",rs("ExpiryDate"))&"/"&datepart("d",rs("ExpiryDate"))&"/"&datepart("yyyy",rs("ExpiryDate")) end if %> Input Data for a New Item

Create New Item

<% if request.querystring("edit") = "true" then %>
<% else %> <% end if %>

Your Name: name="txtName"/>

Item Title: name="txtTitle"/>

Header:

<% dim noc dim doc dim bc noc="" doc="" bc="" if request.querystring("edit") = "true" then select case rs("Type") case "News" noc = "checked="&chr(34)&"true"&chr(34) case "Diary" doc = "checked="&chr(34)&"true"&chr(34) case "Both" bc = "checked="&chr(34)&"true"&chr(34) end select else noc = "checked="&chr(34)&"true"&chr(34) end if %> Item Type
News only name="rgpItemType"/>
Diary only name="rgpItemType"/>
Both name="rgpItemType"/>

Start Date: (month/day/year)
End Date: (month/day/year)

Attachments
<% if request.querystring("edit") = "true" then %> Current File: <%= rs("FileName1") %> " /> Don't change File<% end if %>
<% if request.querystring("edit") = "true" then %> Current File: <%= rs("FileName2") %> " /> Don't change File<% end if %>
<% if request.querystring("edit") = "true" then %> Current File: <%= rs("FileName3") %> " /> Don't change File<% end if %>

<% if request.querystring("edit") = "true" then %> " /> <% end if %>

<% if request.querystring("edit") = "true" then %> <% else %> <% end if %>

Main page

<% if request.querystring("edit") = "true" then rs.Close set rs = nothing conn.Close set conn = nothing end if %>