%
If Request.Cookies("Webmaster") <> "Validated" Then
Response.Redirect("/ctrfiles/stats/login.asp")
End if
Dim MyFile
MyFile = Server.MapPath("/database/houseview.mdb")
Dim DataConnection, cmdDC, RecordSet
Dim RecordToEdit, Updated
Set DataConnection = Server.CreateObject("ADODB.Connection")
DataConnection.ConnectionTimeout = 20
DataConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & MyFile & ";"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConnection
SQL = "SELECT Locations.ID, Locations.* FROM Locations WHERE (((Locations.ID)=" & Request.QueryString("ID") & "));"
cmdDC.CommandText = SQL
Set RecordSet = Server.CreateObject("ADODB.Recordset")
RecordSet.Open cmdDC, , 2, 2
If Request.Form("btnUpdate") = "Update" Then
if Request.Form("Location") = "" then
Response.Write("
You did not Include a Location")
Response.Write ("")
Response.End
end if
RecordSet.Fields("Location") = Request.Form("Location")
RecordSet.Update
Updated = "True"
End If
'-- Delete Button
If Request.Form("btnDelete") = "Delete" and Request.Form("Deleteit") = "on" Then
RecordToDelete = Request.QueryString("ID")
RecordSet.Delete
Updated = "TrueDeleted"
elseif Request.Form("btnDelete") = "Delete" and Request.Form("Deleteit") <> "on" Then
Response.Write("You Pressed Delete without Checking the Delete Checkbox, are sure you want to delete this?")
Response.Write ("")
Response.End
End If
%>
| |
Administration Edit Location::. |
 |
<% If Updated = "True" Then %>
<%= RecordSet.Fields("Location") %> has been Updated!
<% End If %>
<% If Updated = "TrueDeleted" Then %>
Record <%= RecordToDelete %> has been Deleted!
<%
Response.End
End If
%>
<%
RecordSet.Close
Set RecordSet = Nothing
Set cmdDC = Nothing
DataConnection.Close
Set DataConnection = Nothing
%>
|
|
|