navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Form To DB Then CDONTS

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Form To DB Then CDONTS
Page: [1]
 
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
Form To DB Then CDONTS - 2/25/2004 0:10:09   
Hello All.

I have searched the forums and there is a ton of stuff on this but I do not see anything specific to resolve my issue save for 1 and the poster resolved it themselves without posting the fix. :)

I have a form with 13 or so fields that I have posting to a sendmail.asp page that is supposed to update the DB with the contents and then send an email with the info to a designated email addy. I used the microsoft whitepapers to get the code and modifyed it to suite my needs.

I keep getting the following error and I am certain that it is syntax related:
quote:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/test/sendmail.asp, line 98

mySQL= mySQL & "VALUES ('Request.Form("TechExp")','Request.Form("EnvImp")','Request.Form("ProCon")','Request.Form("DesOut")','Request.Form("Overview")','Request.Form("Res")','Request.Form("Test")','Request.Form("Timeline")','Request.Form("HW")','Request.Form("SW")','Request.Form("Lic")','Request.Form("ProjRequester")','Request.Form("submittedWHEN")') "
----------------------------------------------------^


My code of the SENDMAIL.ASP page is as follows, does anyone see anything that would be causing my issue?
<html>

<head>

<%

	'========================================================
	' When you press ENTER in a text box, a carriage return
	' is created. A carriage return is represented by a 
	' Chr(13). Because this information will be displayed 
	' as HTML, replace the carriage returns with 
	' the <br> tag.
	'========================================================
	Function ParseBody(strText)
		'=================================================
		' This function replaces the Chr(13) with a <br>
		' tag in whatever string is passed to it.
		'=================================================
		strText = Replace(strText, Chr(13), "<br>")
		ParseBody = strText
	End Function
	
	
	'========================================================
	' Send results to the database.
	' This portion of the page sends the information
	' from the form to the Northwind sample database.
	'========================================================

	'========================================================
	' Variable declaration:
	'  myConnString = Connection string to database.
	'  myConnection = The database connection object.
	'  mySQL = The query string to be used.
	'========================================================
	Dim myConnString
	Dim myConnection
	Dim mySQL

	'========================================================
	' Set up connection string. When you created the
	' database connection in FrontPage called "Sample", 
	' FrontPage created an Application variable in the 
	' Global.asa file called "Sample_ConnectionString".
	'
	' Use that connection string by populating the
	' myConnString variable with the value contained
	' in the Application variable.
	' 
	'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
	' You can modify this to work with your database by 
	' changing "Sample_ConnectionString" to reflect your
	' FrontPage database connection. For example, if you
	' defined your connection in FrontPage as "Database1",
	' you would change the following line to this:
	'  myConnString = Application("Database1_ConnectionString")
	'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	myConnString = Application("formPROJECTREQUEST_ConnectionString")
	
 
	'========================================================
	' When you are using custom ASP to set up a connection to
	' a database, you use a Connection to connect to the 
	' database. The following line creates that connection and
	' assigns the myConnection variable to contain the 
	' Connection object.
	'======================================================== 
	Set myConnection = Server.CreateObject("ADODB.Connection")
	
	'========================================================
	' After the connection has been created, open it so that 
	' information can be written to the database. To do 
	' that, use the Open method and pass it the connection
	' string that you defined earlier.
	'========================================================
	myConnection.Open myConnString
	
	'========================================================
	' This is the SQL string that queries the database.
	' In this example, Request.Form("[form_field]")
	' pulls information from the form and populates the SQL 
	' string with it.
	' 
	'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	' You can modify this SQL string to work with your own 
	' database by following this format. Pay special 
	' attention to the fact that spaces are not optional.
	' -------------------------------------------------------
	'  mySQL = "INSERT INTO [your_table_name] "
	'  mySQL = mySQL & "([database_field_names]) "
	'  mySQL = mySQL & "VALUES ('[form_field_names]')"
	' -------------------------------------------------------
	' For more information about this, see the 
	' Customizing the Database Page section of this document..
	'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	mySQL= "INSERT INTO projectINFO "
	mySQL= mySQL & "(TechExp,EnvImp,ProCon,DesOut,Overview,Res,Test,Timeline,HW,SW,Lic,ProjRequester,submittedWHEN) "
	mySQL= mySQL & "VALUES ('Request.Form("TechExp")','Request.Form("EnvImp")','Request.Form("ProCon")','Request.Form("DesOut")','Request.Form("Overview")','Request.Form("Res")','Request.Form("Test")','Request.Form("Timeline")','Request.Form("HW")','Request.Form("SW")','Request.Form("Lic")','Request.Form("ProjRequester")','Request.Form("submittedWHEN")') 

	mySQL= "INSERT INTO projectINFO "
	mySQL= mySQL & "(TechExp,EnvImp,ProCon,DesOut,Overview,Res,Test,Timeline,HW,SW,Lic,ProjRequester,submittedWHEN) "
	mySQL= mySQL & "VALUES ('" & Request.Form("TechExp") & "','" 
	mySQL= mySQL & Request.Form("EnvImp") & "'"
	mySQL= mySQL & Request.Form("ProCon") & "'"
	mySQL= mySQL & Request.Form("DesOut") & "'"
	mySQL= mySQL & Request.Form("Overview") & "'"
	mySQL= mySQL & Request.Form("Res") & "'"
	mySQL= mySQL & Request.Form("Test") & "'"
	mySQL= mySQL & Request.Form("Timeline") & "'"
	mySQL= mySQL & Request.Form("HW") & "'"
	mySQL= mySQL & Request.Form("SW") & "'"
	mySQL= mySQL & Request.Form("Lic") & "'"
	mySQL= mySQL & Request.Form("ProjRequester") & "'"
	mySQL= mySQL & Request.Form("submittedWHEN") & "'"	
	
	'========================================================
	' Execute the connection with the SQL string. 
	' This runs the SQL string against the database and inputs
	' the information.
	'=========================================================
	myConnection.Execute mySQL
	
	'=== Close the connection.
	myConnection.Close
			
	'=== Set the connection equal to Nothing. 
	'=== This frees resources used by it.
	Set myConnection = Nothing
	
	
 

	'===================================================================
	' Send the results to e-mail.
	' Use CDONTS to create and send a message based on information 
	' entered into the form. The following lines compose and send
	' the e-mail.
	'===================================================================
  
'====================================================================
' Set up variables:
'	myCDONTSMail = A CDONTS mail object.
'	strFrom = A string containing the source e-mail address.
'	strTo = A string containing the destination e-mail address.
'	strSubject = A string containing the subject of the e-mail.
'	strBody = A string containing the body of the e-mail.
'====================================================================
Dim myCDONTSMail
Dim strFrom
Dim strTo
Dim strSubject
Dim strBody

	'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	' Assign the source e-mail address. Change this to your e-mail
	' address.
	'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strFrom="example@microsoft.com"

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' Assign the destination e-mail address. In this example, get the 
' e-mail address from the form field called "EMail".
' You can customize this by removing the EMail form field and 
' changing the following line to this:
'	strTo="example@microsoft.com" ß Change this to your e-mail 
' address.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strTo=Nate@EGeekBMe.Com

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following line is the subject of the e-mail. You can change 
' this to a subject that is customized to your liking.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strSubject = "Send to E-mail and Database"

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following lines create the body of the message. This can be 
' anything you want it to be.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strBody="The following information was submitted:" & Chr(13)
strBody = strBody & Request.Form("TechExp") & " " 
strBody = strBody & Request.Form("EnvImp")
strBody = strBody & Chr(13) & Request.Form("ProCon") & Chr(13)
strBody = strBody & Request.Form("DesOut") & Chr(13)
strBody = strBody & Request.Form("Overview") & Chr(13)
strBody = strBody & Request.Form("Res") & Chr(13)
strBody = strBody & Request.Form("Test") & Chr(13)
strBody = strBody & Request.Form("Timeline") & Chr(13)
strBody = strBody & Request.Form("HW") & Chr(13)
strBody = strBody & Request.Form("SW") & Chr(13)
strBody = strBody & Request.Form("Lic") & Chr(13)
strBody = strBody & Request.Form("ProjRequester") & Chr(13)
strBody = strBody & Request.Form("submittedWHEN") & Chr(13)

strBody = strBody & Chr(13) & "Thank you for submitting your data."


'====================================================================
' The SET statement creates the CDONTS mail object in preparation
' for sending the e-mail message.
'====================================================================
Set myCDONTSMail = CreateObject("CDONTS.NewMail")

'====================================================================
' The following line sends the mail message using the source e-mail,
' destination e-mail, subject, and body that were defined earlier.
'====================================================================
myCDONTSMail.Send strFrom,strTo,strSubject,strBody

	'=== Set the CDONTS mail object to NOTHING to free resources.
Set myCDONTSMail = Nothing


'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' For information about how to customize the rest of this page, see the 
' Customizing the Confirmation Page section of this document. Sections 
‘ that are discussed in the Customizations section are delimited
' by percent signs.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%>

</head>

<body bgcolor="#FFCC99">

<p><font face="Verdana" color="#FF0000"><b>Thank you for submitting your information!<br>
</b></font><font face="Verdana" size="2">You will receive an e-mail shortly.  The e-mail was sent using the following information:</font></p>
<b><b><font face="Verdana" size="2">Sent To: 

<br>
From    : Microsoft PSS Sample Page</font></b></p>
<p><b><font face="Verdana" size="2">Subject: Send to Database and E-mail</font></b></p>
<p><b><font face="Verdana" size="2">Content: 
</font></b></p>
<hr noshade size="1" style="color: #000000">
<p> </p>

</b>

</body>

</html>


Thanks very much.
Nate

< Message edited by Nathan Goulette -- 2/25/2004 10:57:15 >
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 13:40:54   
The error you are getting refers to a missing double quote (") at the end of this line:

mySQL= mySQL & "VALUES ('Request.Form("TechExp")','Request.Form("EnvImp")','Request.Form("ProCon")','Request.Form("DesOut")','Request.Form("Overview")','Request.Form("Res")','Request.Form("Test")','Request.Form("Timeline")','Request.Form("HW")','Request.Form("SW")','Request.Form("Lic")','Request.Form("ProjRequester")','Request.Form("submittedWHEN")')

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Nathan Goulette)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 13:55:05   
Hey There Duane.

I have added the double quote and the same exact errror still occurs.

I did just notice that the error I posted is missing the little arrow pointing to a specific part of the error.
As soon as I post this message I will edit that in.

Any other thoughts? I have never done a pure asp connection to the DB as I usually use FP but am trying this since I am also trying to use CDONTS. I do have CDONTS working successfully on another site of mine (same host) without issue.

Thanks.
Nate

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 14:05:01   
You can use CDONTS with the DRW. I do it all the time. For an example, see this recent post:

http://www.frontpagewebmaster.com/m-184671/tm.htm

If you already have a FP form that inserts directly to a database, just insert the CDONTS script right after the code that performs the insert.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Nathan Goulette)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 14:28:47   
quote:

mySQL= mySQL & Request.Form("submittedWHEN") & "'"


Have you tried just adding a closing paren?

mySQL= mySQL & Request.Form("submittedWHEN") & "')"

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to BeTheBall)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 17:50:10   
Duane.

On the page that I have my form, info is entered and when submitted is added to the DB.

I have placed the CDONTS mail after the closing form tag and when submit is clicked, the data is entered into the DB but no mail is sent.

I took the cdonts portion out and put it into a new page and changed the properties of the form to post to this new page. When I click submit, the data is passed onto the sendnotice.asp page without error and a few seconds later I get the email.

So the cdonts portion works fine as is and submitting directly to the DB works fine as well. Is there something special I need to do to get the cdonts to process after clicking submit? Am I not putting them in the right spot on the page? Does the CDONTS portion need to be insode the form tag?

Just as a reminder, these fields are not being UPDATED but rather entered fresh every time so there is no page that processes the updates. These are straight from the form.

RDouglass, I have tried adding the parenth you indicated and the error still occurs in the same lcoation.

Thanks

(in reply to rdouglass)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 18:15:13   
Hey Nate. The page that your form is on, is it one where you just right-clicked the form and chose "Send to Database"? If so, try inserting your CDONTS script right after the red code at the very top of the page.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Nathan Goulette)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 20:21:45   
Yes it is one where i right click and chose send to db but there is no red code on the page at all.

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 20:29:32   
Open the page, switch to HTML view and then click "Refresh". The red code should magically appear. Or be real adventuresome and just paste your CDONTS script at the very top of the page and see if it works.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Nathan Goulette)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 20:46:36   
LOL @ magically Appear.

Holy Moley... Why does it do that?

Anywho, I did do that and the date DOES goto the DB.
The Email DOES get sent

But, yes there is always a BUT.

But, the eamil has none of the submitted data. Just the static text that I put in as labels for the results.

More thoughts?

And thanks again for the continued efforts.
Nate

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 21:05:42   
OK, so you got the red code to appear. Did you put the CDONTS script before or after the other red code? It would need to be after.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Nathan Goulette)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 21:25:26   
It is after the red code that "appeared" and right before the the opening HTML tag.

This is what I have in the form page:
<%
' 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
Session.LCID = 1033
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("formPROJECTREQUEST_ConnectionString")
	FP_DumpError strErrorUrl, "Cannot open database"

	fp_rs.Open "projectINFO", 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(13)
	Dim arFormDBFields0(13)
	Dim arFormValues0(13)

	arFormFields0(0) = "ProjRequester"
	arFormDBFields0(0) = "ProjRequester"
	arFormValues0(0) = Request("ProjRequester")
	arFormFields0(1) = "Test"
	arFormDBFields0(1) = "Test"
	arFormValues0(1) = Request("Test")
	arFormFields0(2) = "Lic"
	arFormDBFields0(2) = "Lic"
	arFormValues0(2) = Request("Lic")
	arFormFields0(3) = "Timeline"
	arFormDBFields0(3) = "Timeline"
	arFormValues0(3) = Request("Timeline")
	arFormFields0(4) = "Overview"
	arFormDBFields0(4) = "Overview"
	arFormValues0(4) = Request("Overview")
	arFormFields0(5) = "submittedWHEN"
	arFormDBFields0(5) = "submittedWHEN"
	arFormValues0(5) = Request("submittedWHEN")
	arFormFields0(6) = "SW"
	arFormDBFields0(6) = "SW"
	arFormValues0(6) = Request("SW")
	arFormFields0(7) = "ProCon"
	arFormDBFields0(7) = "ProCon"
	arFormValues0(7) = Request("ProCon")
	arFormFields0(8) = "Res"
	arFormDBFields0(8) = "Res"
	arFormValues0(8) = Request("Res")
	arFormFields0(9) = "TechExp"
	arFormDBFields0(9) = "TechExp"
	arFormValues0(9) = Request("TechExp")
	arFormFields0(10) = "DesOut"
	arFormDBFields0(10) = "DesOut"
	arFormValues0(10) = Request("DesOut")
	arFormFields0(11) = "HW"
	arFormDBFields0(11) = "HW"
	arFormValues0(11) = Request("HW")
	arFormFields0(12) = "EnvImp"
	arFormDBFields0(12) = "EnvImp"
	arFormValues0(12) = Request("EnvImp")

	FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


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

	fp_rs.Close
	fp_conn.Close

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

End If
End If

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

%>
<%
' Declare a variable to contain your mail message
Dim myMail

' Create a new instance of the New Mail Object
Set myMail = CreateObject("CDONTS.NewMail")
Body = Body & "The following information was submitted:" & vbCrlf
Body = Body & "==============================================================" & vbCrlf
Body = Body & "Requested By "& request.form("ProjRequester") & vbCrlf
Body = Body & "On "& request.form("submittedWHEN") & vbCrlf 
Body = Body & "Question 01: "& request.form("TechExp") & vbCrlf 
Body = Body & "Question 02: "& request.form("EnvImp") & vbCrlf
Body = Body & "Question 03: "& request.form("ProCon") & vbCrlf 
Body = Body & "Question 04: "& request.form("DesOut") & vbCrlf
Body = Body & "Question 05: "& request.form("Overview") & vbCrlf 
Body = Body & "Question 06: "& request.form("Res") & vbCrlf
Body = Body & "Question 07: "& request.form("Test") & vbCrlf 
Body = Body & "Question 08: "& request.form("Timeline") & vbCrlf
Body = Body & "Question 09: "& request.form("HW") & vbCrlf 
Body = Body & "Question 10: "& request.form("SW") & vbCrlf
Body = Body & "Question 11: "& request.form("Lic") & vbCrlf 



' Send the message
' This section sends the email and if necessary, reads variables 
' from the email form and assigns them to the variables
' that were declared above
' The format is VariableName=request.form("FormFieldName")
MyMail.From="ngoulette@inpulseresponse.com"
MyMail.To="Nate@EGeekBMe.Com"
myMail.Subject="Project Request Form Submission"
myMail.Body= Body
myMail.Importance="2"
myMail.Send 

' Be sure to set the New Mail Object to Nothing once you've
' sent your message in order to release memory
Set myMail = Nothing
%>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Project Proposal Form</title>
</head>

<body>

<% 
dim todaysDate
 todaysDate=now()
%>

<form method="POST" action="--WEBBOT-SELF--">
  <!--webbot bot="SaveDatabase" suggestedext="asp" s-dataconnection="formPROJECTREQUEST" s-recordsource="projectINFO" u-database-url="_db/ppfr.mdb" s-form-fields="ProjRequester Test Lic Timeline Overview submittedWHEN SW ProCon Res TechExp DesOut HW EnvImp" s-form-dbfields="ProjRequester Test Lic Timeline Overview submittedWHEN SW ProCon Res TechExp DesOut HW EnvImp" 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="40548" --><p><font face="Tahoma" size="5"><b>[ Project Proposal Form ]</b></font></p>
<table border="0" width="100%" id="table1">
	<tr>
		<td align="left" valign="top" width="154"><u><b>
		<font size="4" face="Tahoma">Description</font></b></u></td>
		<td align="left" valign="top" width="221"> </td>
		<td align="right" valign="top" width="155"> </td>
		<td align="left" valign="top"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">Technical 
		Explanation:</font><p> </p>
		<p> </td>
		<td align="left" valign="top" width="221">		
			<p><textarea rows="6" name="TechExp" cols="25" tabindex="1"></textarea></p>

			</td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">How will 
		the environment  be impacted and what are  the system 
		dependencies?</font></td>
		<td align="left" valign="top">
		<textarea rows="6" name="EnvImp" cols="25" tabindex="2"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Pros and 
		Cons:</font><p> </p>
		<p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="6" name="ProCon" cols="25" tabindex="3"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">What is 
		the desired  outcome?</font></td>
		<td align="left" valign="top">
		<textarea rows="6" name="DesOut" cols="25" tabindex="4"></textarea></td>
	</tr>
	<tr>
		<td align="left" valign="top" width="379" height="24" colspan="2"><b>
		<font face="Tahoma" size="4"><br>
		<u>Summary of Action Items</u></font></b></td>
		<td align="right" valign="top" width="155" height="24"> </td>
		<td align="left" valign="top" height="24"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Overview 
		of steps and  estimation of each step's  timeframe  
		requirements:</font><p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="4" name="Overview" cols="25" tabindex="5"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">How many 
		people   <br>
		will be required for  implementation?</font></td>
		<td align="left" valign="top">
		<textarea rows="4" name="Res" cols="25" tabindex="6"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">How will 
		each step be  tested?</font><p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="4" name="Test" cols="25" tabindex="7"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">Overall 
		estimated timeline:</font></td>
		<td align="left" valign="top">
		<textarea rows="4" name="Timeline" cols="25" tabindex="8"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="379" colspan="2">
		<p align="left"><b><font face="Tahoma" size="4"><br>
		<u>Purchasing 
		Requirements</u></font></b></td>
		<td align="right" valign="top" width="155"> </td>
		<td align="left" valign="top"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Hardware:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="HW" cols="25" tabindex="9"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">
        Project Requestor:</font></td>
		<td align="left" valign="top">
        <input type="text" name="ProjRequester" size="33"></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Software:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="SW" cols="25" tabindex="10"></textarea></td>
		<td align="right" valign="top" width="155">
		<p align="center">
		<font size="2"> </font></td>
		<td align="left" valign="top"><font size="2">    </font> 
		</td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">
		Licensing:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="Lic" cols="25" tabindex="11"></textarea></td>
		<td align="right" valign="bottom" width="155">
		<input type="reset" value="Reset" name="B2"></td>
		<td align="left" valign="bottom"> 
		<input type="submit" value="Submit" name="B1"></td>
	</tr>
</table>
  <table border="0" cellspacing="1" width="100%" id="AutoNumber1">
    <tr>
      <td width="100%"> </td>
    </tr>
  </table>
  <input type="hidden" name="submittedWHEN" value="<% Response.write todaysDate %>">
</form>


</body>

</html>

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 21:53:13   
I remember having this same problem about a year ago. Here is the link:

http://www.frontpagewebmaster.com/m-141000/mpage-1/key-cdonts//tm.htm#141000

Essentially, what you need to do is put your CDONTS script between the following two lines, but delete the <% and %> from your CDONTS script as you placing inside another section of code that already has the delimiters. That should work.

fp_conn.Close

FP_FormConfirmation "text/html; charset=windows-1252"

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Nathan Goulette)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 23:13:59   
That didn't work either so I literally replaicated the example that you posted in the link wit hthe exception of my form fields and again, the DB updates but there is no email.

Here is exactly what I have as of current.
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next

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("formPROJECTREQUEST_ConnectionString")
	FP_DumpError strErrorUrl, "Cannot open database"

	fp_rs.Open "projectINFO", 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(13)
	Dim arFormDBFields0(13)
	Dim arFormValues0(13)

	arFormFields0(0) = "ProjRequester"
	arFormDBFields0(0) = "ProjRequester"
	arFormValues0(0) = Request("ProjRequester")
	arFormFields0(1) = "Test"
	arFormDBFields0(1) = "Test"
	arFormValues0(1) = Request("Test")
	arFormFields0(2) = "Lic"
	arFormDBFields0(2) = "Lic"
	arFormValues0(2) = Request("Lic")
	arFormFields0(3) = "Timeline"
	arFormDBFields0(3) = "Timeline"
	arFormValues0(3) = Request("Timeline")
	arFormFields0(4) = "Overview"
	arFormDBFields0(4) = "Overview"
	arFormValues0(4) = Request("Overview")
	arFormFields0(5) = "submittedWHEN"
	arFormDBFields0(5) = "submittedWHEN"
	arFormValues0(5) = Request("submittedWHEN")
	arFormFields0(6) = "SW"
	arFormDBFields0(6) = "SW"
	arFormValues0(6) = Request("SW")
	arFormFields0(7) = "ProCon"
	arFormDBFields0(7) = "ProCon"
	arFormValues0(7) = Request("ProCon")
	arFormFields0(8) = "Res"
	arFormDBFields0(8) = "Res"
	arFormValues0(8) = Request("Res")
	arFormFields0(9) = "TechExp"
	arFormDBFields0(9) = "TechExp"
	arFormValues0(9) = Request("TechExp")
	arFormFields0(10) = "DesOut"
	arFormDBFields0(10) = "DesOut"
	arFormValues0(10) = Request("DesOut")
	arFormFields0(11) = "HW"
	arFormDBFields0(11) = "HW"
	arFormValues0(11) = Request("HW")
	arFormFields0(12) = "EnvImp"
	arFormDBFields0(12) = "EnvImp"
	arFormValues0(12) = Request("EnvImp")

	FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


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

	fp_rs.Close
	fp_conn.Close

	Session(" FP_SavedFields" )=arFormFields0 
	Session(" FP_SavedValues" )=arFormValues0 
	Response.Redirect " confirm.asp" 

End If
End If

%>
<% 
Dim objMail 
Set objMail = Server.CreateObject(" CDONTS.NewMail" ) 

HTML = HTML & " <HTML>" 
HTML = HTML & " <HEAD>" 
HTML = HTML & " <TITLE>Send Mail with HTML</TITLE>" 
HTML = HTML & " </HEAD>" 
HTML = HTML & " <BODY>" 
HTML = HTML & " <TABLE cellpadding=""2"" width=""96%"">" 
HTML = HTML & " <TR><FONT SIZE=""4"">" 
HTML = HTML & " A Project Request Form Has Been Submitted. The details are as follows:<BR>" 
HTML = HTML & " <BR>Requestors Name: " & Request.Form(" ProjRequester" )
HTML = HTML & " <BR>Request Date " & Request.Form(" submittedWHEN" ) 
HTML = HTML & " <BR>Q01: " & Request.Form(" TechExp" ) 
HTML = HTML & " <BR>Q02: " & Request.Form(" EnvImp" ) 
HTML = HTML & " <BR>Q03: " & Request.Form(" ProCon" ) 
HTML = HTML & " <BR>Q04: " & Request.Form(" DesOut" ) 
HTML = HTML & " <BR>Q05: " & Request.Form(" Overview" ) 
HTML = HTML & " <BR>Q06: " & Request.Form(" Res" )
HTML = HTML & " <BR>Q07: " & Request.Form(" Test" ) 
HTML = HTML & " <BR>Q08: " & Request.Form(" Timeline" ) 
HTML = HTML & " <BR>Q09: " & Request.Form(" HW" )
HTML = HTML & " <BR>Q08: " & Request.Form(" SW" ) 
HTML = HTML & " <BR>Q09: " & Request.Form(" Lic" )
HTML = HTML & " </FONT></TR>" 
HTML = HTML & " <TR><TD>" 
HTML = HTML & " </FONT></TD></TR></TABLE><BR><BR>" 
HTML = HTML & " </BODY>" 
HTML = HTML & " </HTML>" 

objMail.From = " NGoulette@InPulseResponse.Com" 
objMail.Subject = " Project Request Submission" 

objMail.BodyFormat = 0 
objMail.MailFormat = 0 
objMail.Importance = 2 
objMail.To = " Nate@EGeekBMe.Com" 
objMail.Body = HTML 
objMail.Send 
set objMail = nothing 
%>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Project Proposal Form</title>
</head>

<body>

<% 
dim todaysDate
 todaysDate=now()
%>

<form method="POST" action="--WEBBOT-SELF--">
  <!--webbot bot="SaveDatabase" suggestedext="asp" u-asp-include-url="_fpclass/fpdbform.inc" s-dataconnection="formPROJECTREQUEST" s-recordsource="projectINFO" u-database-url="_db/ppfr.mdb" u-confirmation-url="test.asp" s-form-fields="ProjRequester Test Lic Timeline Overview submittedWHEN SW ProCon Res TechExp DesOut HW EnvImp" s-form-dbfields="ProjRequester Test Lic Timeline Overview submittedWHEN SW ProCon Res TechExp DesOut HW EnvImp" --><p><font face="Tahoma" size="5"><b>[ Project Proposal Form ]</b></font></p>
<table border="0" width="100%" id="table1">
	<tr>
		<td align="left" valign="top" width="154"><u><b>
		<font size="4" face="Tahoma">Description</font></b></u></td>
		<td align="left" valign="top" width="221"> </td>
		<td align="right" valign="top" width="155"> </td>
		<td align="left" valign="top"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">Technical 
		Explanation:</font><p> </p>
		<p> </td>
		<td align="left" valign="top" width="221">		
			<p><textarea rows="6" name="TechExp" cols="25" tabindex="1"></textarea></p>

			</td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">How will 
		the environment  be impacted and what are  the system 
		dependencies?</font></td>
		<td align="left" valign="top">
		<textarea rows="6" name="EnvImp" cols="25" tabindex="2"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Pros and 
		Cons:</font><p> </p>
		<p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="6" name="ProCon" cols="25" tabindex="3"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">What is 
		the desired  outcome?</font></td>
		<td align="left" valign="top">
		<textarea rows="6" name="DesOut" cols="25" tabindex="4"></textarea></td>
	</tr>
	<tr>
		<td align="left" valign="top" width="379" height="24" colspan="2"><b>
		<font face="Tahoma" size="4"><br>
		<u>Summary of Action Items</u></font></b></td>
		<td align="right" valign="top" width="155" height="24"> </td>
		<td align="left" valign="top" height="24"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Overview 
		of steps and  estimation of each step's  timeframe  
		requirements:</font><p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="4" name="Overview" cols="25" tabindex="5"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">How many 
		people   <br>
		will be required for  implementation?</font></td>
		<td align="left" valign="top">
		<textarea rows="4" name="Res" cols="25" tabindex="6"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">How will 
		each step be  tested?</font><p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="4" name="Test" cols="25" tabindex="7"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">Overall 
		estimated timeline:</font></td>
		<td align="left" valign="top">
		<textarea rows="4" name="Timeline" cols="25" tabindex="8"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="379" colspan="2">
		<p align="left"><b><font face="Tahoma" size="4"><br>
		<u>Purchasing 
		Requirements</u></font></b></td>
		<td align="right" valign="top" width="155"> </td>
		<td align="left" valign="top"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Hardware:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="HW" cols="25" tabindex="9"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">
        Project Requestor:</font></td>
		<td align="left" valign="top">
        <input type="text" name="ProjRequester" size="33"></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Software:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="SW" cols="25" tabindex="10"></textarea></td>
		<td align="right" valign="top" width="155">
		<p align="center">
		<font size="2"> </font></td>
		<td align="left" valign="top"><font size="2">    </font> 
		</td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">
		Licensing:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="Lic" cols="25" tabindex="11"></textarea></td>
		<td align="right" valign="bottom" width="155">
		<input type="reset" value="Reset" name="B2"></td>
		<td align="left" valign="bottom"> 
		<input type="submit" value="Submit" name="B1"></td>
	</tr>
</table>
  <table border="0" cellspacing="1" width="100%" id="AutoNumber1">
    <tr>
      <td width="100%"> </td>
    </tr>
  </table>
  <input type="hidden" name="submittedWHEN" value="<% Response.write todaysDate %>">
</form>


</body>

</html>

Thanks Again.
Nate

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/25/2004 23:25:53   
You need to do a mini diet on your code and move the script slightly. Try this:

<%

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
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("formPROJECTREQUEST_ConnectionString")
	FP_DumpError strErrorUrl, "Cannot open database"

	fp_rs.Open "projectINFO", 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(13)
	Dim arFormDBFields0(13)
	Dim arFormValues0(13)

	arFormFields0(0) = "ProjRequester"
	arFormDBFields0(0) = "ProjRequester"
	arFormValues0(0) = Request("ProjRequester")
	arFormFields0(1) = "Test"
	arFormDBFields0(1) = "Test"
	arFormValues0(1) = Request("Test")
	arFormFields0(2) = "Lic"
	arFormDBFields0(2) = "Lic"
	arFormValues0(2) = Request("Lic")
	arFormFields0(3) = "Timeline"
	arFormDBFields0(3) = "Timeline"
	arFormValues0(3) = Request("Timeline")
	arFormFields0(4) = "Overview"
	arFormDBFields0(4) = "Overview"
	arFormValues0(4) = Request("Overview")
	arFormFields0(5) = "submittedWHEN"
	arFormDBFields0(5) = "submittedWHEN"
	arFormValues0(5) = Request("submittedWHEN")
	arFormFields0(6) = "SW"
	arFormDBFields0(6) = "SW"
	arFormValues0(6) = Request("SW")
	arFormFields0(7) = "ProCon"
	arFormDBFields0(7) = "ProCon"
	arFormValues0(7) = Request("ProCon")
	arFormFields0(8) = "Res"
	arFormDBFields0(8) = "Res"
	arFormValues0(8) = Request("Res")
	arFormFields0(9) = "TechExp"
	arFormDBFields0(9) = "TechExp"
	arFormValues0(9) = Request("TechExp")
	arFormFields0(10) = "DesOut"
	arFormDBFields0(10) = "DesOut"
	arFormValues0(10) = Request("DesOut")
	arFormFields0(11) = "HW"
	arFormDBFields0(11) = "HW"
	arFormValues0(11) = Request("HW")
	arFormFields0(12) = "EnvImp"
	arFormDBFields0(12) = "EnvImp"
	arFormValues0(12) = Request("EnvImp")

	FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


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

	fp_rs.Close
	fp_conn.Close 
	
	' Declare a variable to contain your mail message
Dim myMail

' Create a new instance of the New Mail Object
Set myMail = CreateObject("CDONTS.NewMail")
Body = Body & "The following information was submitted:" & vbCrlf
Body = Body & "==============================================================" & vbCrlf
Body = Body & "Requested By "& request.form("ProjRequester") & vbCrlf
Body = Body & "On "& request.form("submittedWHEN") & vbCrlf 
Body = Body & "Question 01: "& request.form("TechExp") & vbCrlf 
Body = Body & "Question 02: "& request.form("EnvImp") & vbCrlf
Body = Body & "Question 03: "& request.form("ProCon") & vbCrlf 
Body = Body & "Question 04: "& request.form("DesOut") & vbCrlf
Body = Body & "Question 05: "& request.form("Overview") & vbCrlf 
Body = Body & "Question 06: "& request.form("Res") & vbCrlf
Body = Body & "Question 07: "& request.form("Test") & vbCrlf 
Body = Body & "Question 08: "& request.form("Timeline") & vbCrlf
Body = Body & "Question 09: "& request.form("HW") & vbCrlf 
Body = Body & "Question 10: "& request.form("SW") & vbCrlf
Body = Body & "Question 11: "& request.form("Lic") & vbCrlf 

' Send the message
' This section sends the email and if necessary, reads variables 
' from the email form and assigns them to the variables
' that were declared above
' The format is VariableName=request.form("FormFieldName")
MyMail.From="ngoulette@inpulseresponse.com"
MyMail.To="Nate@EGeekBMe.Com"
myMail.Subject="Project Request Form Submission"
myMail.Body= Body
myMail.Importance="2"
myMail.Send 

' Be sure to set the New Mail Object to Nothing once you've
' sent your message in order to release memory
Set myMail = Nothing

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

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
%>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Project Proposal Form</title>
</head>

<body>

<% 
dim todaysDate
 todaysDate=now()
%>

<form method="POST" action="--WEBBOT-SELF--">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="_fpclass/fpdbform.inc"--><p><font face="Tahoma" size="5"><b>[ Project Proposal Form ]</b></font></p>
<table border="0" width="100%" id="table1">
	<tr>
		<td align="left" valign="top" width="154"><u><b>
		<font size="4" face="Tahoma">Description</font></b></u></td>
		<td align="left" valign="top" width="221"> </td>
		<td align="right" valign="top" width="155"> </td>
		<td align="left" valign="top"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">Technical 
		Explanation:</font><p> </p>
		<p> </td>
		<td align="left" valign="top" width="221">		
			<p><textarea rows="6" name="TechExp" cols="25" tabindex="1"></textarea></p>

			</td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">How will 
		the environment  be impacted and what are  the system 
		dependencies?</font></td>
		<td align="left" valign="top">
		<textarea rows="6" name="EnvImp" cols="25" tabindex="2"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Pros and 
		Cons:</font><p> </p>
		<p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="6" name="ProCon" cols="25" tabindex="3"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">What is 
		the desired  outcome?</font></td>
		<td align="left" valign="top">
		<textarea rows="6" name="DesOut" cols="25" tabindex="4"></textarea></td>
	</tr>
	<tr>
		<td align="left" valign="top" width="379" height="24" colspan="2"><b>
		<font face="Tahoma" size="4"><br>
		<u>Summary of Action Items</u></font></b></td>
		<td align="right" valign="top" width="155" height="24"> </td>
		<td align="left" valign="top" height="24"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Overview 
		of steps and  estimation of each step's  timeframe  
		requirements:</font><p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="4" name="Overview" cols="25" tabindex="5"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">How many 
		people   <br>
		will be required for  implementation?</font></td>
		<td align="left" valign="top">
		<textarea rows="4" name="Res" cols="25" tabindex="6"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">How will 
		each step be  tested?</font><p> </td>
		<td align="left" valign="top" width="221">
		<textarea rows="4" name="Test" cols="25" tabindex="7"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">Overall 
		estimated timeline:</font></td>
		<td align="left" valign="top">
		<textarea rows="4" name="Timeline" cols="25" tabindex="8"></textarea></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="379" colspan="2">
		<p align="left"><b><font face="Tahoma" size="4"><br>
		<u>Purchasing 
		Requirements</u></font></b></td>
		<td align="right" valign="top" width="155"> </td>
		<td align="left" valign="top"> </td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Hardware:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="HW" cols="25" tabindex="9"></textarea></td>
		<td align="right" valign="top" width="155"><font face="Tahoma" size="2">
        Project Requestor:</font></td>
		<td align="left" valign="top">
        <input type="text" name="ProjRequester" size="33"></td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">Software:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="SW" cols="25" tabindex="10"></textarea></td>
		<td align="right" valign="top" width="155">
		<p align="center">
		<font size="2"> </font></td>
		<td align="left" valign="top"><font size="2">    </font> 
		</td>
	</tr>
	<tr>
		<td align="right" valign="top" width="154"><font face="Tahoma" size="2">
		Licensing:</font></td>
		<td align="left" valign="top" width="221">
		<textarea rows="3" name="Lic" cols="25" tabindex="11"></textarea></td>
		<td align="right" valign="bottom" width="155">
		<input type="reset" value="Reset" name="B2"></td>
		<td align="left" valign="bottom"> 
		<input type="submit" value="Submit" name="B1"></td>
	</tr>
</table>
  <table border="0" cellspacing="1" width="100%" id="AutoNumber1">
    <tr>
      <td width="100%"> </td>
    </tr>
  </table>
  <input type="hidden" name="submittedWHEN" value="<% Response.write todaysDate %>">
</form>


</body>

</html>


_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Nathan Goulette)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/26/2004 1:23:13   
Hot Diggity!

Whatever you did, that worked. I will need to compare the codes to see what is was different that you did.

Now i just need to figure out how to grab teh ppID number from the record that was just created and include it in the email. I know there is a tutorial on that and will do some checking around.

Thanks again Duane.
Nate

(in reply to BeTheBall)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/26/2004 2:01:15   
ok, I have the obtaining the record number and adding it to the url to be included in the email part.

However, how do I go about chanign the default cionfirmation page to a desgnated I page I have made called confirmation.asp?

I have tried the normal methods but the FP functionality is no longer there.

Thanks

(in reply to Nathan Goulette)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Form To DB Then CDONTS - 2/26/2004 11:05:05   
Replace:

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

With


Session("FP_SavedFields")=arFormFields0
Session("FP_SavedValues")=arFormValues0
Response.Redirect "Confirmation.asp"

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Nathan Goulette)
Nathan Goulette

 

Posts: 274
Joined: 1/12/2003
From: Phoenix, AZ
Status: offline

 
RE: Form To DB Then CDONTS - 2/26/2004 11:51:16   
Good To Go!

Thanks Again Man!

(in reply to BeTheBall)
ohioholiday

 

Posts: 20
Joined: 8/18/2004
Status: offline

 
RE: Form To DB Then CDONTS - 8/20/2004 19:32:50   
I have followed this whole thread and can't seem to get my script to work no matter where I put it on the page:

<%

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("corrflex_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(17)
Dim arFormDBFields0(17)
Dim arFormValues0(17)

arFormFields0(0) = "Component_JDE_No0"
arFormDBFields0(0) = "Component_JDE_No"
arFormValues0(0) = Request("Component_JDE_No0")
arFormFields0(1) = "CAD_Number"
arFormDBFields0(1) = "CAD_Number"
arFormValues0(1) = Request("CAD_Number")
arFormFields0(2) = "ExtraMylar"
arFormDBFields0(2) = "ExtraMylar"
arFormValues0(2) = Request("ExtraMylar")
arFormFields0(3) = "CUSTOMER"
arFormDBFields0(3) = "CUSTOMER"
arFormValues0(3) = Request("CUSTOMER")
arFormFields0(4) = "ITEM"
arFormDBFields0(4) = "ITEM"
arFormValues0(4) = Request("ITEM")
arFormFields0(5) = "SpecialInstructions"
arFormDBFields0(5) = "SpecialInstructions1"
arFormValues0(5) = Request("SpecialInstructions")
arFormFields0(6) = "DateDieNeeded"
arFormDBFields0(6) = "DateDieNeeded"
arFormValues0(6) = Request("DateDieNeeded")
arFormFields0(7) = "MATERIAL"
arFormDBFields0(7) = "MATERIAL"
arFormValues0(7) = Request("MATERIAL")
arFormFields0(8) = "Machine_Quoted1"
arFormDBFields0(8) = "Item_Is"
arFormValues0(8) = Request("Machine_Quoted1")
arFormFields0(9) = "Project_Parent_JDE_No"
arFormDBFields0(9) = "Project_Parent_JDE_No"
arFormValues0(9) = Request("Project_Parent_JDE_No")
arFormFields0(10) = "OFFICE"
arFormDBFields0(10) = "OFFICE"
arFormValues0(10) = Request("OFFICE")
arFormFields0(11) = "CS_Rep"
arFormDBFields0(11) = "CS_Rep"
arFormValues0(11) = Request("CS_Rep")
arFormFields0(12) = "Embossing_No"
arFormDBFields0(12) = "Embossing_No"
arFormValues0(12) = Request("Embossing_No")
arFormFields0(13) = "Buyer"
arFormDBFields0(13) = "Buyer"
arFormValues0(13) = Request("Buyer")
arFormFields0(14) = "DATE"
arFormDBFields0(14) = "DATE"
arFormValues0(14) = Request("DATE")
arFormFields0(15) = "Machine_Quoted"
arFormDBFields0(15) = "Machine_Quoted"
arFormValues0(15) = Request("Machine_Quoted")
arFormFields0(16) = "SalesRep"
arFormDBFields0(16) = "SalesRep"
arFormValues0(16) = Request("SalesRep")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type"
End If
If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "Remote_computer_name"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("REMOTE_USER") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name"
End If

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

fp_rs.Close
fp_conn.Close

Dim myMail

' Create a new instance of the New Mail Object
Set myMail = CreateObject("CDONTS.NewMail")
Body = Body & "The following information was submitted:" & vbCrlf
Body = Body & "==============================================================" & vbCrlf
Body = Body & "On "& request.form("DATE") & vbCrlf
Body = Body & "OFFICE: "& request.form("OFFICE") & vbCrlf
Body = Body & "DATE DIE NEEDED: "& request.form("DateDieNeeded") & vbCrlf
Body = Body & "CUSTOMER: "& request.form("CUSTOMER") & vbCrlf
Body = Body & "ITEM "& request.form("ITEM") & vbCrlf
Body = Body & "CAD NUMBER: "& request.form("CAD_Number") & vbCrlf
Body = Body & "PROJECT/PARENT/JDE NO: "& request.form("Project_Parent_JDE_No") & vbCrlf
Body = Body & "ITEM IS: "& request.form("Item_Is") & vbCrlf
Body = Body & "COMPONENT JDE NO: "& request.form("Component_JDE_No") & vbCrlf
Body = Body & "MACHINE QUOTED: "& request.form("Machine_Quoted") & vbCrlf
Body = Body & "EXTRA MYLAR: "& request.form("ExtraMylar") & vbCrlf
Body = Body & "EMBOSSING NO: "& request.form("Embossing_No") & vbCrlf
Body = Body & "SPECIAL INSTRUCTIONS: "& request.form("SpecialInstructions") & vbCrlf
Body = Body & "SALES REP: "& request.form("SalesRep") & vbCrlf
Body = Body & "CS REP: "& request.form("CS_Rep") & vbCrlf
Body = Body & "BUYER: "& request.form("Buyer") & vbCrlf

' Send the message
' This section sends the email and if necessary, reads variables
' from the email form and assigns them to the variables
' that were declared above
' The format is VariableName=request.form("FormFieldName")
MyMail.From="weborder@dynamicdies.com"
MyMail.To="administrator@dynamicdies.com"
myMail.Subject="Corflex WebForm Submission"
myMail.Body= Body
myMail.Importance="2"
myMail.Send

' Be sure to set the New Mail Object to Nothing once you've
' sent your message in order to release memory
Set myMail = Nothing

FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"cutting_die_request_form.asp",_
"Return to the form."
End If
End If

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

%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script language="JavaScript" src="corrflex_interface/Results/editor/calendar2.js"></script>
<title>Cutting Die Request Form</title>
<script language="JavaScript">

function FP_swapImg() {//v1.0
var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_preloadImgs() {//v1.0
var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
for(var i=0; i<a.length; i++) { d.FP_imgs=new Image; d.FP_imgs.src=a; }
}

function FP_getObjectByID(id,o) {//v1.0
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
return null;
}
</script>
<meta name="Microsoft Theme" content="watermar 1011, default">
</head>

<body onload="FP_preloadImgs(/*url*/'images/buttonF.jpg', /*url*/'images/buttonE.jpg', /*url*/'corrflex_interface/Results/editor/button73.jpg', /*url*/'corrflex_interface/Results/editor/button72.jpg')">

<form name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" action="cdontstest.asp" method="POST">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" i-checksum="40548" endspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0">
<table width="100%" align="left">
<tr>
<td width="50%"> <p><font size="+3" color="#000080"><b>Cutting
Die Request Form</b></font></p>
</td>
<td width="50%" align="right"><a href="index.htm">
<img border="0" id="img11" src="images/buttonD.jpg" height="25" width="125" alt="Home Page" fp-style="fp-btn: Corporate 4; fp-font-size: 14; fp-orig: 0" fp-title="Home Page" onmouseover="FP_swapImg(1,0,/*id*/'img11',/*url*/'images/buttonE.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img11',/*url*/'images/buttonD.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img11',/*url*/'images/buttonF.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img11',/*url*/'images/buttonE.jpg')"></a><table>
<tr>
<td>
<a href="corrflex_interface/Results/CDresults_page.asp" target="_top">
Results Page</a> | Order Form </td>
</tr>
</table>
</td>
</tr>
</table>
<p><br clear="all">
</p>
<hr>
<table border="0" width="100%" cellspacing="1">
<tr>
<td width="291"><b>ENTRY DATE</b></td>
<td>
<!--webbot bot="Validation" s-display-name="DATE" s-data-type="String" b-value-required="True" i-maximum-length="0" --><input name="DATE" size="19" value="<%=Date%>" tabindex="0"></td>
</tr>
<tr>
<td width="291"><b>CUSTOMER</b></td>
<td><nobr>
<!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM CUSTOMER ORDER BY CUSTOMER ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="corrflex"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="CUSTOMER"
fp_sMenuValue="CUSTOMER"
fp_sColTypes="&ID=3&CUSTOMER=202&"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<select name="CUSTOMER" size="1" tabindex="3">
<!--#include file="_fpclass/fpdbrgn1.inc"--><!--webbot bot="AspInclude" endspan i-checksum="62210" -->
<option><%=ucase(FP_FieldHTML(fp_rs,"CUSTOMER"))%></option>
<!--#include file="_fpclass/fpdbrgn2.inc"--><!--webbot bot="AspInclude" endspan i-checksum="62218" -->
</select>
<!--webbot bot="DatabaseRegionEnd" endspan --><a href="Add%20customer.asp"><img border="0" id="img1" src="corrflex_interface/Results/editor/button71.jpg" height="45" width="225" alt="Click Here to Enter New Customer" fp-style="fp-btn: Braided Row 3; fp-orig: 0" fp-title="Click Here to Enter New Customer" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'corrflex_interface/Results/editor/button72.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'corrflex_interface/Results/editor/button71.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'corrflex_interface/Results/editor/button73.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'corrflex_interface/Results/editor/button72.jpg')"></a></nobr></td>
</tr>
<tr>
<td width="291"><b>OFFICE</b></td>
<td><select size="1" name="OFFICE" tabindex="1">
<option value="Erlanger">Erlanger</option>
<option value="Winston-Salem">Winston-Salem</option>
</select></td>
</tr>
<tr>
<td width="291"><b>Date Die Needed</b></td>
<td><input name="DateDieNeeded" value size="15" tabindex="2">
<a href="javascript:cal1.popup();">
<img src="corrflex_interface/Results/editor/img/cal.gif" border="0" alt="Click Here to Pick up the date"></a> 
Click on icon for popup calendar</td>
</tr>
<tr>
<td width="291"><b>ITEM </b> </td>
<td>
<input name="ITEM" size="55" value maxlength="255" tabindex="4"></td>
</tr>
<tr>
<td width="291"><b>CAD #:</b></td>
<td>
<input name="CAD_Number" size="25" value maxlength="255" tabindex="5"></td>
</tr>
<tr>
<td width="291"><b>PROJECT/PARENT/JDE#</b></td>
<td>
<!--webbot bot="Validation" s-display-name="Project_Parent_JDE_No" s-data-type="String" b-value-required="True" i-maximum-length="255" --><input name="Project_Parent_JDE_No" size="55" value maxlength="255" tabindex="6"></td>
</tr>
<tr>
<td width="291"><b>COMPONENT/JDE# </b></td>
<td>
 <!--webbot bot="Validation" s-display-name="Component_JDE_No" s-data-type="String" b-value-required="True" i-maximum-length="255" --><input name="Component_JDE_No" size="55" value maxlength="255" tabindex="7"></td>
</tr>
<tr>
<td width="291"><b>ITEM IS:</b></td>
<td><select size="1" name="Item_Is" tabindex="8">
<option value="Printed">Printed</option>
<option value="Litho">Litho</option>
<option value="Plain">Plain</option>
</select> </td>
</tr>
<tr>
<td width="291"><b>MATERIAL:</b></td>
<td><select size="1" name="MATERIAL" tabindex="9">
<option value="Chemi">Chemi</option>
<option value="C-white">C-white</option>
<option value="CIP">CIP</option>
<option value="Kraft">Kraft</option>
<option value="Special">Special</option>
</select> </td>
</tr>
<tr>
<td width="291"><b>MACHINE QUOTED:</b></td>
<td><select size="1" name="Machine_Quoted" tabindex="10">
<option value="Bobst 1600 CL2 (BM)">Bobst 1600 CL2 (BM)</option>
<option value="Bobst 2000 CL2 (BG)">Bobst 2000 CL2 (BG)</option>
<option value="Kauae (Thomson)">Kauae (Thomson)</option>
<option value="Hycorr 66x80">Hycorr 66x80"</option>
<option value="Staley 66x130">Staley 66x130"</option>
</select> </td>
</tr>
<tr>
<td width="291"><b>EXTRA MYLAR:</b></td>
<td>
<input name="ExtraMylar" size="50" value maxlength="255" tabindex="11"></td>
</tr>
<tr>
<td width="291"><b>EMBOSSING#:</b></td>
<td>
<input name="Embossing_No" size="20" value maxlength="255" tabindex="12"></td>
</tr>
<tr>
<td width="291"><b>SPECIAL INSTRUCTIONS</b></td>
<td>
<input type="text" name="SpecialInstructions" size="100" tabindex="13"></td>
</tr>
<tr>
<td width="291"><b>SALES REP:</b></td>
<td>
<input name="SalesRep" size="64" value maxlength="255" tabindex="14"></td>
</tr>
<tr>
<td width="291"><b>CS REP:     </b></td>
<td>
<input name="CS_Rep" size="64" value maxlength="255" tabindex="15"></td>
</tr>
<tr>
<td width="291"><b>BUYER:   </b></td>
<td>
<input name="Buyer" size="64" value maxlength="255" tabindex="16"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="Submit"><input type="reset" value=" Reset "><script language="JavaScript">

<!-- Begin
if (window.print) {
document.write('<form>'
+ '<input type=button name=print value="Print Page" '
+ 'onClick="javascript:window.print()"> </form>');
}
// End -->
</script></p>
<p> </p>
</form>
<form method="POST" action="--WEBBOT-SELF--">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="1">
<script language="JavaScript">
var cal1 = new calendar2(document.forms['FrontPage_Form1'].elements['DateDieNeeded']);
cal1.year_scroll = true;
cal1.time_comp = false;
</script>
</span>
</form>


</body>

</html>

(in reply to BeTheBall)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Form To DB Then CDONTS
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote