<%@ Language=VBScript %> <%Response.Buffer = true%> <% dim oRS dim oConn dim strSQL 'If this is coming from the filled out form below... if Request.QueryString("type") = "Add" then 'Open a connection Set oConn = Server.CreateObject("ADODB.Connection") Set oRS = Server.CreateObject("ADODB.Recordset") oConn.Open Application("ConnectionString") 'First check to see if they are already in the email list strSQL = "SELECT * from tblEmailRecipients "&_ "WHERE lastName = '" & Request("txtLName") & "'"&_ "AND emailAddress = '" & Request("txtEmail") & "'" oRS.Open strSQL, oConn, 3, 3 if not oRS.eof then oRS.Close Response.Redirect "mailinglist.asp?stat=existing" else strSQL = "INSERT into tblEmailRecipients(firstName, lastName, emailAddress) VALUES "&_ "('" & Trim(Request("txtFName")) & "','" & Trim(Request("txtLName")) & "','" & Trim(Request("txtEmail")) & "')" oConn.Execute(strSQL) Response.Redirect "mailinglist.asp?stat=added" end if elseif Request.QueryString("type") = "Delete" then 'Open a connection Set oConn = Server.CreateObject("ADODB.Connection") Set oRS = Server.CreateObject("ADODB.Recordset") oConn.Open Application("ConnectionString") strSQL = "SELECT emailID from tblEmailRecipients "&_ "WHERE upper(lastName) = upper('" & Request("txtLName") & "') "&_ "AND emailAddress = '" & Request("txtEmail") & "'" oRS.Open strSQL, oConn, 3, 3 if not oRS.eof then strSQL = "DELETE from tblEmailRecipients "&_ "WHERE emailID = " & oRS(0) 'the recordset ID oConn.Execute(strSQL) oRS.Close Response.Redirect "mailinglist.asp?stat=removed" else Response.Redirect "mailinglist.asp?stat=notmember" end if end if %> ChemAssociates' Mailing List
Join Our Mailing List
Our mailing list is down until further notice.  We'll have it working again soon!