Post to DB and e-mail

L

lmossolle

Is there a way that when you click ok, it will post to a db as well as e-mail
someone giving the results? Please assist!!!!

Here is my Code...

<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("database1_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic,
adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(11)
Dim arFormDBFields0(11)
Dim arFormValues0(11)

arFormFields0(0) = "Date"
arFormDBFields0(0) = "Date"
arFormValues0(0) = Request("Date")
arFormFields0(1) = "Name"
arFormDBFields0(1) = "Name"
arFormValues0(1) = Request("Name")
arFormFields0(2) = "Section"
arFormDBFields0(2) = "Section"
arFormValues0(2) = Request("Section")
arFormFields0(3) = "Floor"
arFormDBFields0(3) = "Floor"
arFormValues0(3) = Request("Floor")
arFormFields0(4) = "Wing"
arFormDBFields0(4) = "Wing"
arFormValues0(4) = Request("Wing")
arFormFields0(5) = "RoomNumber"
arFormDBFields0(5) = "RoomNumber"
arFormValues0(5) = Request("RoomNumber")
arFormFields0(6) = "ProblemDescription"
arFormDBFields0(6) = "ProblemDescription"
arFormValues0(6) = Request("ProblemDescription")
arFormFields0(7) = "TechAssigned"
arFormDBFields0(7) = "TechAssigned"
arFormValues0(7) = Request("TechAssigned")
arFormFields0(8) = "ActionsTaken"
arFormDBFields0(8) = "ActionsTaken"
arFormValues0(8) = Request("ActionsTaken")
arFormFields0(9) = "DateCompleted"
arFormDBFields0(9) = "DateCompleted"
arFormValues0(9) = Request("DateCompleted")
arFormFields0(10) = "Hrs"
arFormDBFields0(10) = "Hrs"
arFormValues0(10) = Request("Hrs")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

FP_FormConfirmationFromArrays "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"submission_form.asp",_
"Return to the form.",_
arFormDBFields0,_
arFormValues0

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>


<% Response.Buffer = True %>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- New</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Microsoft Theme" content="axis 011, default">
</head>

<body>

<table width="100%" align=left>
<tr>
<td width="43%">
<b><font size=+3 color="#000080"> Submission Form </font></b>
</td>
<td width="57%" align=right>
<table width="447">
<tr>
<td width="441">
<a href="results_page.asp" target="_top">Results Page</a> |
Submission Form
| <a href="editor/database_editor.asp" target="_top">Database Editor</a>

</td>
</tr>
</table>
</td>
</tr>
</table>


<p>
<br clear="all">
<hr>
<p>

<form METHOD="POST" action="--WEBBOT-SELF--" onsubmit="return
FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">

<!--webbot bot="SaveDatabase" suggestedext="asp"
s-dataconnection="database1" s-recordsource="Results" s-form-fields="Date
Name Section Floor Wing RoomNumber ProblemDescription TechAssigned
ActionsTaken DateCompleted Hrs" s-form-dbfields="Date Name Section Floor Wing
RoomNumber ProblemDescription TechAssigned ActionsTaken DateCompleted Hrs "
b-usedbfieldsforconfirmation="True"
u-asp-include-url="../../_fpclass/fpdbform.inc" startspan --><input
TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
file="../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan
i-checksum="43152" -->

<p><b> Date</b><br>
<!--webbot bot="Validation" s-display-name="Date" s-data-type="String"
b-value-required="False" i-maximum-length="0" --><input type="TEXT"
name="Date" size="19" value="<%=Date%>"><br>
</p>
<p><b> Name</b><br>
<!--webbot bot="Validation" s-display-name="Name" s-data-type="String"
b-value-required="False" i-maximum-length="255" --><input type="TEXT"
name="Name" size="31" value="" maxlength="255"><br>
</p>
<p><b> Section
Floor Wing Room Number</b><br>
<select size="1" name="Section">
<option value="ACAP">ACAP</option>
<option value="DA Photo Studio">DA Photo Studio</option>
<option value="Demobilization">Demobilization</option>
<option value="IAG">IAG</option>
<option value="ID Card Facility ">ID Card Facility</option>
<option value="IRB">IRB</option>
<option value="ITO">ITO</option>
<option value="Outprocess">Outprocess</option>
<option value="PAB">PAB</option>
<option value="Retention">Retention</option>
<option value="RSO">RSO</option>
<option value="Student Records">Student Records</option>
<option value="TSO">TSO</option>
</select>
<!--webbot bot="Validation" s-display-name="Floor" s-data-type="String"
b-value-required="False" i-maximum-length="255" --><input type="TEXT"
name="Floor" size="15" value="" maxlength="255">
<!--webbot bot="Validation" s-display-name="Wing" s-data-type="String"
b-value-required="False" i-maximum-length="255" --><input type="TEXT"
name="Wing" size="15" value="" maxlength="255">
<!--webbot bot="Validation" s-display-name="RoomNumber" s-data-type="String"
b-value-required="False" i-maximum-length="255" --><input type="TEXT"
name="RoomNumber" size="18" value="" maxlength="255"><br>
</p>
<p align="left"> <b> Problem Description</b><br>
<!--webbot bot="Validation" s-display-name="ProblemDescription"
s-data-type="String" b-value-required="False" i-maximum-length="255"
--><input type="TEXT" name="ProblemDescription" size="64" value=""
maxlength="255"><br>
</p>
<p><b>Tech Assigned</b><br>
<select size="1" name="TechAssigned">
<option value="Lee Mossolle">Lee Mossolle</option>
<option value="Robert Zekanis">Robert Zekanis</option>
</select>
<br>
</p>
<p><b>Actions Taken</b><br>
<!--webbot bot="Validation" s-display-name="ActionsTaken"
s-data-type="String" b-value-required="False" i-maximum-length="255"
--><input type="TEXT" name="ActionsTaken" size="64" value=""
maxlength="255"><br>
</p>
<p><b>Date Completed</b><br>
<!--webbot bot="Validation" s-display-name="DateCompleted"
s-data-type="String" b-value-required="False" i-maximum-length="0" --><input
type="TEXT" name="DateCompleted" size="19" value="<%=Date%>"><br>
</p>
<p><b>Hrs</b><br>
<!--webbot bot="Validation" s-display-name="Hrs" s-data-type="String"
b-value-required="False" i-maximum-length="255" --><input type="TEXT"
name="Hrs" size="19" value="" maxlength="255"><br>
</p>


<p><input type="submit" value=" OK "><input type="reset" value=" Reset
"></p>

</form>

</body>

</html>
 
T

Thomas A. Rowe

See:
http://support.microsoft.com/default.aspx?scid=kb;[LN];Q275251

Also apply to FP2002 and FP2003, but may need to use CDOSYS, so then you need to see:
http://quadcomm.com/tips/sendCDOSYSmail.asp

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top