PC Review


Reply
Thread Tools Rate Thread

cdo nearly there I think

 
 
SS
Guest
Posts: n/a
 
      1st Aug 2006
Hi

Further to my posting below I think I'm nearly there and have now changed
some of the scripting. I now get the information to go to the database and
the mail arrives with the field names but not the information that was typed
into the fields !

Do hope someone can help?

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

<%


Dim sTextBody
Dim sName



Set cdoConfig = CreateObject("CDO.Configuration")


sTextBody = sTextBody & "Name: " & Request("sName") & VbCrLf



With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.server.name"
.Update
End With



Dim objMail
'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
'Set key properties
objMail.From = (E-Mail Removed)
objMail.To = "(E-Mail Removed)"
objMail.Subject = "Software Required"
objMail.TextBody = sTextBody


objMail.Send



' End If

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>


<%
' 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("Name_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(8)
Dim arFormDBFields0(8)
Dim arFormValues0(8)


arFormFields0(4) = "sName"
arFormDBFields0(4) = "sName"
arFormValues0(4) = Request("sName")


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:",_
"sendmail1.asp",_
"Return to the form."

End If
End If

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

%>

Thanks Shona


 
Reply With Quote
 
 
 
 
Bob Lehmann
Guest
Posts: n/a
 
      2nd Aug 2006
>> Further to my posting below

Please keep the coversation in the original thread.

Some people are unwilling to search for the original message, or it may have
been deleted from their newsreader.

Bob Lehmann

"SS" <(E-Mail Removed)> wrote in message
news:eanvg9$8dq$(E-Mail Removed)...
> Hi
>
> Further to my posting below I think I'm nearly there and have now changed
> some of the scripting. I now get the information to go to the database

and
> the mail arrives with the field names but not the information that was

typed
> into the fields !
>
> Do hope someone can help?
>
> <!--
> METADATA
> TYPE="typelib"
> UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
> NAME="CDO for Windows 2000 Library"
> -->
>
> <%
>
>
> Dim sTextBody
> Dim sName
>
>
>
> Set cdoConfig = CreateObject("CDO.Configuration")
>
>
> sTextBody = sTextBody & "Name: " & Request("sName") & VbCrLf
>
>
>
> With cdoConfig.Fields
> .Item(cdoSendUsingMethod) = cdoSendUsingPort
> .Item(cdoSMTPServer) = "smtp.server.name"
> .Update
> End With
>
>
>
> Dim objMail
> 'Create the mail object
> Set objMail = Server.CreateObject("CDO.Message")
> 'Set key properties
> objMail.From = (E-Mail Removed)
> objMail.To = "(E-Mail Removed)"
> objMail.Subject = "Software Required"
> objMail.TextBody = sTextBody
>
>
> objMail.Send
>
>
>
> ' End If
>
> Set cdoMessage = Nothing
> Set cdoConfig = Nothing
> %>
>
>
> <%
> ' 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("Name_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(8)
> Dim arFormDBFields0(8)
> Dim arFormValues0(8)
>
>
> arFormFields0(4) = "sName"
> arFormDBFields0(4) = "sName"
> arFormValues0(4) = Request("sName")
>
>
> 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:",_
> "sendmail1.asp",_
> "Return to the form."
>
> End If
> End If
>
> Session.CodePage = Session("FP_OldCodePage")
> Session.LCID = Session("FP_OldLCID")
>
> %>
>
> Thanks Shona
>
>



 
Reply With Quote
 
Stefan B Rusynko
Guest
Posts: n/a
 
      2nd Aug 2006
Your Code is requesting only the data from 1 form field (the form field is named sName)
sTextBody = sTextBody & "Name: " & Request("sName") & VbCrLf


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPa...3/Default.aspx
_____________________________________________


"SS" <(E-Mail Removed)> wrote in message news:eanvg9$8dq$(E-Mail Removed)...
| Hi
|
| Further to my posting below I think I'm nearly there and have now changed
| some of the scripting. I now get the information to go to the database and
| the mail arrives with the field names but not the information that was typed
| into the fields !
|
| Do hope someone can help?
|
| <!--
| METADATA
| TYPE="typelib"
| UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
| NAME="CDO for Windows 2000 Library"
| -->
|
| <%
|
|
| Dim sTextBody
| Dim sName
|
|
|
| Set cdoConfig = CreateObject("CDO.Configuration")
|
|
| sTextBody = sTextBody & "Name: " & Request("sName") & VbCrLf
|
|
|
| With cdoConfig.Fields
| .Item(cdoSendUsingMethod) = cdoSendUsingPort
| .Item(cdoSMTPServer) = "smtp.server.name"
| .Update
| End With
|
|
|
| Dim objMail
| 'Create the mail object
| Set objMail = Server.CreateObject("CDO.Message")
| 'Set key properties
| objMail.From = (E-Mail Removed)
| objMail.To = "(E-Mail Removed)"
| objMail.Subject = "Software Required"
| objMail.TextBody = sTextBody
|
|
| objMail.Send
|
|
|
| ' End If
|
| Set cdoMessage = Nothing
| Set cdoConfig = Nothing
| %>
|
|
| <%
| ' 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("Name_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(8)
| Dim arFormDBFields0(8)
| Dim arFormValues0(8)
|
|
| arFormFields0(4) = "sName"
| arFormDBFields0(4) = "sName"
| arFormValues0(4) = Request("sName")
|
|
| 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:",_
| "sendmail1.asp",_
| "Return to the form."
|
| End If
| End If
|
| Session.CodePage = Session("FP_OldCodePage")
| Session.LCID = Session("FP_OldLCID")
|
| %>
|
| Thanks Shona
|
|


 
Reply With Quote
 
SS
Guest
Posts: n/a
 
      2nd Aug 2006
Yes I thought lets see if I can get it to at least work with one field
before I move on.

Any more thoughts?

Cheers Shona



"Stefan B Rusynko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Your Code is requesting only the data from 1 form field (the form field is

named sName)
> sTextBody = sTextBody & "Name: " & Request("sName") & VbCrLf
>
>
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> To find the best Newsgroup for FrontPage support see:
> http://www.frontpagemvps.com/FrontPa...3/Default.aspx
> _____________________________________________
>
>
> "SS" <(E-Mail Removed)> wrote in message

news:eanvg9$8dq$(E-Mail Removed)...
> | Hi
> |
> | Further to my posting below I think I'm nearly there and have now

changed
> | some of the scripting. I now get the information to go to the database

and
> | the mail arrives with the field names but not the information that was

typed
> | into the fields !
> |
> | Do hope someone can help?
> |
> | <!--
> | METADATA
> | TYPE="typelib"
> | UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
> | NAME="CDO for Windows 2000 Library"
> | -->
> |
> | <%
> |
> |
> | Dim sTextBody
> | Dim sName
> |
> |
> |
> | Set cdoConfig = CreateObject("CDO.Configuration")
> |
> |
> | sTextBody = sTextBody & "Name: " & Request("sName") & VbCrLf
> |
> |
> |
> | With cdoConfig.Fields
> | .Item(cdoSendUsingMethod) = cdoSendUsingPort
> | .Item(cdoSMTPServer) = "smtp.server.name"
> | .Update
> | End With
> |
> |
> |
> | Dim objMail
> | 'Create the mail object
> | Set objMail = Server.CreateObject("CDO.Message")
> | 'Set key properties
> | objMail.From = (E-Mail Removed)
> | objMail.To = "(E-Mail Removed)"
> | objMail.Subject = "Software Required"
> | objMail.TextBody = sTextBody
> |
> |
> | objMail.Send
> |
> |
> |
> | ' End If
> |
> | Set cdoMessage = Nothing
> | Set cdoConfig = Nothing
> | %>
> |
> |
> | <%
> | ' 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("Name_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(8)
> | Dim arFormDBFields0(8)
> | Dim arFormValues0(8)
> |
> |
> | arFormFields0(4) = "sName"
> | arFormDBFields0(4) = "sName"
> | arFormValues0(4) = Request("sName")
> |
> |
> | 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:",_
> | "sendmail1.asp",_
> | "Return to the form."
> |
> | End If
> | End If
> |
> | Session.CodePage = Session("FP_OldCodePage")
> | Session.LCID = Session("FP_OldLCID")
> |
> | %>
> |
> | Thanks Shona
> |
> |
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:16 PM.