%
Session("CurrentPage") = "AdminMail"
If Session( "LoginID" ) < "1" Then
Response.Redirect( "adminlogin.asp" )
End If
%>
<%
Dim dbConn, Rs, strX
'Open up a database connection and set up the recordset
Set dbConn = Session("dbConn")
Set Rs = Server.CreateObject("adodb.recordset")
Rs.Cursortype=adOpenDynamic
Rs.LockType=adLockOptimistic
If rqs("do") = "add" or rqs("do") = "edit" Then
'Get the details from the user via a form
rsw( strHeader )
IF rqs("do") = "add" Then
strX = "SELECT * FROM MailingList WHERE [ID] < 0"
Else
strX = "SELECT * FROM MailingList WHERE [ID] = " & rqs("id")
End If
Rs.Open strX, dbConn
rsw("")
%>
<%
Rs.Close
ElseIf rqs("do") = "delete" Then
'delete the record'
on error resume next
If rqs("id") <> "" Then
cSQL = "DELETE * FROM MailingList WHERE ID = " & rqs("id")
dbConn.Execute(cSQL)
End If
If Err.Number = 0 Then
response.redirect( Session("CurrentPage") & ".asp" )
Else
rsw( strHeader )
WriteDBError "CANT DELETE THE RECORD",err.Description,cSQL
End If
on error goto 0
ElseIf rqs("do") = "update" Then
'Submit the details back to the database
IF rqf("id") < "1" Then
cSQL = "INSERT INTO MailingList( Email, FullName ) " & _
"VALUES( " & _
strSQLField(rqf("Email"),"c") & ", " & _
strSQLField(rqf("FullName"),"n") & " )"
Else
cSQL = "UPDATE MailingList SET " & _
"[Email] = " & strSQLField(rqf("email"),"c") & ", " & _
"[FullName] = " & strSQLField(rqf("fullname"),"n") & " " & _
"WHERE ID = " & rqf( "id" )
End If
on error resume next
dbConn.Execute(cSQL)
If Err.Number = 0 Then
response.redirect( Session("CurrentPage") & ".asp?d=" & now() )
Else
rsw( strHeader )
WriteDBError "CANT UPDATE THE RECORD",err.Description,cSQL
End If
on error goto 0
Else
cSearch = Request.Form("searchfor")
rsw( vbCrLF & vbCrLF )
rsw( "" )
End If
%>
This system acts as a duplicate to the actual mailing database held at Groovy Train. It uses emails to keep the live Groovy Train database up to date. You cannot gaurantee when emails arrive at their destination or sometimes they goes missing all together. As a result these databases may be out of sync. If this scenario is discovered, just re-enter the details again to re-create the email.
rain database up to date. You cannot gaurantee when emails arrive at their destination or sometimes they goes missing all together. As a result these databases may be out of sync. If this scenario is discovered, just re-enter the details again to re-create the email.