Change CDOSYS Session Values to DB Values (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


evanesnard -> Change CDOSYS Session Values to DB Values (5/27/2006 16:26:52)

I could really use some help changing my CDOSYS session values to DB values.

Upon arriving at the page that has this CDOSYS code embedded in it, I have queried the DB and have just submitted an update to the DB, and I’m now sitting at the confirmation page which posts the actual update to the DB. That’s the page I have this CDOSYS code embedded in.

I need my CODOSYS code to include the current record’s DB values instead of the session values as I currently have it coded.

I have tried FieldHTML(fp_rs,"My_DBColumn") and FP_FieldVal(fp_rs,"My_DBColumn") in place of Session("My_DBColumn") but that has not worked.

The sequence of events is like this:

1) The User logs into Spooky Login and is automatically directed to a Control Panel page much like success.asp.
2) That control panel page automatically displays a DRW with a list of the User’s Ads.
3) From there, the user clicks on an “Edit” link next to each corresponding ad. The edit link, which includes an Ad_ID parameter, links to an edit page.
4) Next, the user submits the edit page which goes to a confirmation page.
5) The confirmation page must be submitted to post the update to the DB Ad record.

Here’s the CDOSYS code I currently have. This CDOSYS code is currently working great, I just need DB values instead of session values.

Any help on this would be greatly appreciated.

<%DIM strText

strText = ""
strText = strText & "<html>" & VbCrLf
strText = strText & "<body>" & VbCrLf
strText = strText & "<table>" & VbCrLf
strText = strText & "<tr><td>" & VbCrLf
strText = strText & "Hello Admin," & "</p>"
strText = strText & "The following Ad has been Approved." & "</p>"
strText = strText & "Ad ID: " & Session("Ad_ID") & "<br>"
strText = strText & "Ad Category: " & Session("Ad_Category") & "<br>"
strText = strText & "Ad City: " & Session("Ad_City") & "<br>"
strText = strText & "Ad State: " & Session("Ad_State") & "<br>"
strText = strText & "Ad Country: " & Session("Ad_Country") & "</p>"
strText = strText & "Account ID: " & Session("UserID") & "<br>"
strText = strText & "Account Login Name: " & Session("UserName") & "<br>"
strText = strText & "Account First Name: " & Session("x_Firstname") & "<br>"
strText = strText & "Account Last Name: " & Session("x_Lastname") & "<br>"

strText = strText & "</td></tr></table>" & VbCrLf
strText = strText & "</body></html>" & VbCrLf

DIM strText2

strText2 = ""
strText2 = strText2 & "<html>" & VbCrLf
strText2 = strText2 & "<body>" & VbCrLf
strText2 = strText2 & "<table>" & VbCrLf
strText2 = strText2 & "<tr><td>" & VbCrLf
strText2 = strText2 & "Hello " & Session("x_Firstname") & "," & "</p>"
strText2 = strText2 & "Your following Ad at www.mydomain.com has been Approved." & "</p>"
strText2 = strText2 & "This email is for your records. You do not need to reply back to this email." & "</p>"
strText2 = strText2 & "Ad ID: " & Session("Ad_ID") & "<br>"
strText2 = strText2 & "Ad Category: " & Session("Ad_Category") & "<br>"
strText2 = strText2 & "Ad City: " & Session("Ad_City") & "<br>"
strText2 = strText2 & "Ad State: " & Session("Ad_State") & "<br>"
strText2 = strText2 & "Ad Country: " & Session("Ad_Country") & "</p>"
strText2 = strText2 & "Your Account Login Name: " & Session("UserName") & "<br>"
strText2 = strText2 & "Your Account First Name: " & Session("x_Firstname") & "<br>"
strText2 = strText2 & "Your Account Last Name: " & Session("x_Lastname") & "</p>"

strText2 = strText2 & "Best Regards," & "<br>"
strText2 = strText2 & "The Team at www.mydomain.com" & "<br>"
strText2 = strText2 & "</td></tr></table>" & VbCrLf
strText2 = strText2 & "</body></html>" & VbCrLf

call sendEmail("me@mydomain.com"," me@mydomain.com ","Ad Approved",strText)
call sendEmail("me@mydomain.com.com",Session("x_Email"),"Your Ad at www.mydomain.com",strText2)%>

<%
FUNCTION sendEmail(myMailFrom,myMailTo,myMailSubject,strText)
Const cdoSendUsingPort = 2
Const strSmartHost = "localhost"

Set myMail = CreateObject("CDO.Message")
Set iConf = myMail.Configuration

With iConf.Fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Update
End With

With iConf.Fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Update
End With

With myMail
myMail.From = myMailFrom
myMail.To = myMailTo
myMail.Subject = myMailSubject
myMail.HTMLBody = strText
myMail.Send
End With


Set myMail = Nothing
END FUNCTION
%>




BeTheBall -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 19:46:51)

Shouldn't be too difficult. Is there a query to the db on the page?




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 21:11:56)

Thanks Duane. Yes, there is a query to the DB on that page. It's a DRW with a custom query.

UPDATE Ads SET Action_Last = ::Action_Last::, Action_Last_Date = ::Action_Last_Date::, Action_Last_UserID = ::Action_Last_UserID::, Action_History = ::Action_History::, Action_History_Date = ::Action_History_Date::, Action_History_UserID = ::Action_History_UserID::, Disposition = ::Disposition::, Ad_Status = '::Ad_Status::' WHERE Ad_ID = ::Ad_ID::


The whole DRW looks like this:
<%
fp_sQry="UPDATE Ads SET Action_Last = ::Action_Last::, Action_Last_Date = ::Action_Last_Date::, Action_Last_UserID = ::Action_Last_UserID::, Action_History = ::Action_History::, Action_History_Date = ::Action_History_Date::, Action_History_UserID = ::Action_History_UserID::, Disposition = ::Disposition::, Ad_Status = '::Ad_Status::' WHERE Ad_ID = ::Ad_ID::"
fp_sDefault="Action_Last=&Action_Last_Date=&Action_Last_UserID=&Action_History=&Action_History_Date=&Action_History_UserID=&Disposition=&Ad_Status=&Ad_ID="
fp_sNoRecords=""
fp_sDataConn="Signup"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&Timestamp=135&Browser_type=202&User_name=202&Remote_computer_name=202&Terms_Of_Use=202&Contact_Time=202&Contact_Website=202&Contact_IM=202&Contact_Email=202&Contact_Pager_PIN=202&Contact_Pager=202&Contact_Phone_2=202&Contact_Phone_1=202&Contact_Zip_Code=202&Contact_City=202&Contact_State=202&Contact_Country=202&Contact_Last_Name=202&Contact_First_Name=202&Payment_Accepted_Comments=202&Payment_Accepted=202&Payment_Terms=202&Rates=202&Service_References=202&Service_Degrees_Certifications=202&Service_Qualifications=202&Service_Area=202&Service_Details=202&Service_Type=202&Business_Zip_Code=202&Business_City=202&Business_State=202&Business_Country=202&Business_Address=202&Business_Hours=202&Company_Formed=202&Individual_Name=202&Company_Name=202&Business_or_Individual=202&Ad_Category_Details=202&Ad_Category=202&Ad_City=202&Ad_State=202&Ad_Country=202&Ad_ID=3&Ad_Status=202&Disposition=202&Action_History_UserID=203&Action_History_Date=203&Action_History=203&Action_Last_UserID=202&Action_Last_Date=135&Action_Last=202&Advertiser_ID=202&x_Email=202&x_City=202&x_Country=202&x_Lastname=202&x_Firstname=202&Password=202&UserName=202&UserID=3&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>






BeTheBall -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 21:17:51)

OK, but that query will not return a recordset therefore giving you no values to use. You can add a second DRW to the page that pulls the values you need. You will probably want to assign those values to variables so as to be able to use them outside the DRW and in the CDO script. If you can create a DRW that pulls the data you need and post the code here I can show you how to assign the values to variables and plug them into your email script.




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 21:22:06)

Sounds good Duane. Give me a few minutes and let me create that second DRW and I'll post the code.




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 21:36:11)

OK Duane. Here's the code for the second DRW I added to the page where I already have the CDOSYS code.

I hope this is right. In this DRW, I added all the DB fields that I need values from to insert into the CDOSYS code. I did not build the DRW with a custom query but rather the pure DRW. I hope that's right.

<%
fp_sQry="SELECT * FROM Ads WHERE (Ad_ID =  ::Ad_ID::)"
fp_sDefault="Ad_ID="
fp_sNoRecords="<tr><td colspan=10 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Signup"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&UserID=3&UserName=202&Password=202&x_Firstname=202&x_Lastname=202&x_Country=202&x_City=202&x_Email=202&Advertiser_ID=202&Action_Last=202&Action_Last_Date=135&Action_Last_UserID=202&Action_History=203&Action_History_Date=203&Action_History_UserID=203&Disposition=202&Ad_Status=202&Ad_ID=3&Ad_Country=202&Ad_State=202&Ad_City=202&Ad_Category=202&Ad_Category_Details=202&Business_or_Individual=202&Company_Name=202&Individual_Name=202&Company_Formed=202&Business_Hours=202&Business_Address=202&Business_Country=202&Business_State=202&Business_City=202&Business_Zip_Code=202&Service_Type=202&Service_Details=202&Service_Area=202&Service_Qualifications=202&Service_Degrees_Certifications=202&Service_References=202&Rates=202&Payment_Terms=202&Payment_Accepted=202&Payment_Accepted_Comments=202&Contact_First_Name=202&Contact_Last_Name=202&Contact_Country=202&Contact_State=202&Contact_City=202&Contact_Zip_Code=202&Contact_Phone_1=202&Contact_Phone_2=202&Contact_Pager=202&Contact_Pager_PIN=202&Contact_Email=202&Contact_IM=202&Contact_Website=202&Contact_Time=202&Terms_Of_Use=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&FileName=202&"
fp_iDisplayCols=10
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>




BeTheBall -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 21:46:45)

OK, clear everything between these two lines:

<!--#include file="_fpclass/fpdbrgn1.inc"-->

<!--#include file="_fpclass/fpdbrgn2.inc"-->

Then between those lines create your variables, something like this:

<%
varUserID = FP_FieldVal(fp_rs,"UserID")
varUserName = FP_FieldVal(fp_rs,"UserName")
etc.
%>

Once that is done, put your CDOSYS script after the DRW and you can use your variables, like this:

strText = strText & "Ad City: " & varCity & "<br>"

Does that make sense?




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 21:51:48)

Makes perfectly clear sense. Let me make those changes and I'll get back with you in about 10-15 minutes and let you know how it went. Thanks!




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 22:20:55)

Thanks Duane.

I made those changes and the page ran fine and I received the CDOSYS email however, the only value that was correct was the Ad_ID.

All the other values were still session values for some reason, which was odd because I don't have any references to session in the CDOSYS code at this point.




BeTheBall -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 22:56:21)

That is odd. Go ahead and post the full code for the page. (Hint: Put the code between the following tags to make it post better in the forum:
Your Code Goes Here
)




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 23:04:12)

<%
fp_sQry="SELECT * FROM Ads WHERE (Ad_ID =  ::Ad_ID:: AND Ad_Category =  '::Ad_Category::' AND Ad_City =  '::Ad_City::' AND Ad_State =  '::Ad_State::' AND Ad_Country =  '::Ad_Country::' AND UserID =  ::UserID:: AND UserName =  '::UserName::' AND x_Firstname =  '::x_Firstname::' AND x_Lastname =  '::x_Lastname::' AND x_Email =  '::x_Email::')"
fp_sDefault="Ad_ID=&Ad_Category=&Ad_City=&Ad_State=&Ad_Country=&UserID=&UserName=&x_Firstname=&x_Lastname=&x_Email="
fp_sNoRecords="<tr><td colspan=10 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Signup"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Ad_ID"
fp_sMenuValue="Ad_ID"
fp_sColTypes="&UserID=3&UserName=202&Password=202&x_Firstname=202&x_Lastname=202&x_Country=202&x_City=202&x_Email=202&Advertiser_ID=202&Action_Last=202&Action_Last_Date=135&Action_Last_UserID=202&Action_History=203&Action_History_Date=203&Action_History_UserID=203&Disposition=202&Ad_Status=202&Ad_ID=3&Ad_Country=202&Ad_State=202&Ad_City=202&Ad_Category=202&Ad_Category_Details=202&Business_or_Individual=202&Company_Name=202&Individual_Name=202&Company_Formed=202&Business_Hours=202&Business_Address=202&Business_Country=202&Business_State=202&Business_City=202&Business_Zip_Code=202&Service_Type=202&Service_Details=202&Service_Area=202&Service_Qualifications=202&Service_Degrees_Certifications=202&Service_References=202&Rates=202&Payment_Terms=202&Payment_Accepted=202&Payment_Accepted_Comments=202&Contact_First_Name=202&Contact_Last_Name=202&Contact_Country=202&Contact_State=202&Contact_City=202&Contact_Zip_Code=202&Contact_Phone_1=202&Contact_Phone_2=202&Contact_Pager=202&Contact_Pager_PIN=202&Contact_Email=202&Contact_IM=202&Contact_Website=202&Contact_Time=202&Terms_Of_Use=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&FileName=202&"
fp_iDisplayCols=10
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="47136" --><tr>
<%
varAd_ID = FP_FieldVal(fp_rs,"Ad_ID") 
varAd_Category = FP_FieldVal(fp_rs,"Ad_Category") 
varAd_City = FP_FieldVal(fp_rs,"Ad_City") 
varAd_State = FP_FieldVal(fp_rs,"Ad_State") 
varAd_Country = FP_FieldVal(fp_rs,"Ad_Country") 
varUserID = FP_FieldVal(fp_rs,"UserID") 
varUserName = FP_FieldVal(fp_rs,"UserName")
varx_Firstname = FP_FieldVal(fp_rs,"x_Firstname") 
varx_Lasttname = FP_FieldVal(fp_rs,"x_Lastname") 
varx_Email = FP_FieldVal(fp_rs,"x_Email") 
%>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" -->

<%DIM strText 

strText = "" 
strText = strText & "<html>" & VbCrLf 
strText = strText & "<body>" & VbCrLf 
strText = strText & "<table>" & VbCrLf 
strText = strText & "<tr><td>" & VbCrLf 
strText = strText & "Hello Evan," & "</p>"
strText = strText & "The following Ad has been Approved." & "</p>"
strText = strText & "Ad ID: " & varAd_ID & "<br>" 
strText = strText & "Ad Category: " & varAd_Category & "<br>" 
strText = strText & "Ad City: " & varAd_City & "<br>"
strText = strText & "Ad State: " & varAd_State & "<br>" 
strText = strText & "Ad Country: " & varAd_Country & "</p>" 
strText = strText & "Account ID: " & varUserID & "<br>"
strText = strText & "Account Login Name: " & varUserName & "<br>"
strText = strText & "Account First Name: " & varx_Firstname & "<br>"
strText = strText & "Account Last Name: " & varx_Lastname & "<br>"
strText = strText & "</td></tr></table>" & VbCrLf 
strText = strText & "</body></html>" & VbCrLf 

DIM strText2

strText2 = "" 
strText2 = strText2 & "<html>" & VbCrLf 
strText2 = strText2 & "<body>" & VbCrLf 
strText2 = strText2 & "<table>" & VbCrLf 
strText2 = strText2 & "<tr><td>" & VbCrLf 
strText2 = strText2 & "Hello " & varx_Firstname & "," & "</p>"
strText2 = strText2 & "Your following Ad at www.mydomain.com has been Approved." & "</p>"
strText2 = strText2 & "This email is for your records.  You do not need to reply back to this email." & "</p>"
strText2 = strText2 & "Ad ID: " & varAd_ID & "<br>" 
strText2 = strText2 & "Ad Category: " & varAd_Category & "<br>" 
strText2 = strText2 & "Ad City: " & varAd_City & "<br>"
strText2 = strText2 & "Ad State: " & varAd_State & "<br>" 
strText2 = strText2 & "Ad Country: " & varAd_Country & "</p>"
strText2 = strText2 & "Your Account Login Name: " & varUserName & "<br>"
strText2 = strText2 & "Your Account First Name: " & varx_Firstname & "<br>"
strText2 = strText2 & "Your Account Last Name: " & varx_Lastname & "</p>"
strText2 = strText2 & "Best Regards," & "<br>"
strText2 = strText2 & "The Team at www.mydomain.com" & "<br>"
strText2 = strText2 & "</td></tr></table>" & VbCrLf 
strText2 = strText2 & "</body></html>" & VbCrLf

call sendEmail("me@mydomain.com","me@mydomain.com","Ad Approved",strText)
call sendEmail("me@mydomain.com",varx_Email,"Your Ad at www.mydomain.com",strText2)%>

<%
FUNCTION sendEmail(myMailFrom,myMailTo,myMailSubject,strText)
Const cdoSendUsingPort = 2
Const strSmartHost = "localhost"

Set myMail = CreateObject("CDO.Message")
Set iConf = myMail.Configuration
	
With iConf.Fields
	.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
	.Update
End With

With iConf.Fields
	.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
	.Update
End With

With myMail
	myMail.From = myMailFrom
	myMail.To = myMailTo
	myMail.Subject = myMailSubject
	myMail.HTMLBody = strText
	myMail.Send
End With


Set myMail = Nothing
END FUNCTION
%>






Spooky -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 23:43:25)

Is there any reason to have all those comparisons in the SQL?
Isnt Ad_ID unique?

<%
fp_sQry="SELECT * FROM Ads WHERE (Ad_ID =  ::Ad_ID::)"
fp_sDefault="Ad_ID=&Ad_Category=&Ad_City=&Ad_State=&Ad_Country=&UserID=&UserName=&x_Firstname=&x_Lastname=&x_Email="
fp_sNoRecords="<tr><td colspan=10 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Signup"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Ad_ID"
fp_sMenuValue="Ad_ID"
fp_sColTypes="&UserID=3&UserName=202&Password=202&x_Firstname=202&x_Lastname=202&x_Country=202&x_City=202&x_Email=202&Advertiser_ID=202&Action_Last=202&Action_Last_Date=135&Action_Last_UserID=202&Action_History=203&Action_History_Date=203&Action_History_UserID=203&Disposition=202&Ad_Status=202&Ad_ID=3&Ad_Country=202&Ad_State=202&Ad_City=202&Ad_Category=202&Ad_Category_Details=202&Business_or_Individual=202&Company_Name=202&Individual_Name=202&Company_Formed=202&Business_Hours=202&Business_Address=202&Business_Country=202&Business_State=202&Business_City=202&Business_Zip_Code=202&Service_Type=202&Service_Details=202&Service_Area=202&Service_Qualifications=202&Service_Degrees_Certifications=202&Service_References=202&Rates=202&Payment_Terms=202&Payment_Accepted=202&Payment_Accepted_Comments=202&Contact_First_Name=202&Contact_Last_Name=202&Contact_Country=202&Contact_State=202&Contact_City=202&Contact_Zip_Code=202&Contact_Phone_1=202&Contact_Phone_2=202&Contact_Pager=202&Contact_Pager_PIN=202&Contact_Email=202&Contact_IM=202&Contact_Website=202&Contact_Time=202&Terms_Of_Use=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&FileName=202&"
fp_iDisplayCols=10
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<%
varAd_ID = FP_FieldVal(fp_rs,"Ad_ID") 
varAd_Category = FP_FieldVal(fp_rs,"Ad_Category") 
varAd_City = FP_FieldVal(fp_rs,"Ad_City") 
varAd_State = FP_FieldVal(fp_rs,"Ad_State") 
varAd_Country = FP_FieldVal(fp_rs,"Ad_Country") 
varUserID = FP_FieldVal(fp_rs,"UserID") 
varUserName = FP_FieldVal(fp_rs,"UserName")
varx_Firstname = FP_FieldVal(fp_rs,"x_Firstname") 
varx_Lasttname = FP_FieldVal(fp_rs,"x_Lastname") 
varx_Email = FP_FieldVal(fp_rs,"x_Email") 
%>
<!--#include file="_fpclass/fpdbrgn2.inc"-->

<%DIM strText 

strText = "" 
strText = strText & "<html>" & VbCrLf 
strText = strText & "<body>" & VbCrLf 
strText = strText & "<table>" & VbCrLf 
strText = strText & "<tr><td>" & VbCrLf 
strText = strText & "Hello Evan," & "</p>"
strText = strText & "The following Ad has been Approved." & "</p>"
strText = strText & "Ad ID: " & varAd_ID & "<br>" 
strText = strText & "Ad Category: " & varAd_Category & "<br>" 
strText = strText & "Ad City: " & varAd_City & "<br>"
strText = strText & "Ad State: " & varAd_State & "<br>" 
strText = strText & "Ad Country: " & varAd_Country & "</p>" 
strText = strText & "Account ID: " & varUserID & "<br>"
strText = strText & "Account Login Name: " & varUserName & "<br>"
strText = strText & "Account First Name: " & varx_Firstname & "<br>"
strText = strText & "Account Last Name: " & varx_Lastname & "<br>"
strText = strText & "</td></tr></table>" & VbCrLf 
strText = strText & "</body></html>" & VbCrLf 

DIM strText2

strText2 = "" 
strText2 = strText2 & "<html>" & VbCrLf 
strText2 = strText2 & "<body>" & VbCrLf 
strText2 = strText2 & "<table>" & VbCrLf 
strText2 = strText2 & "<tr><td>" & VbCrLf 
strText2 = strText2 & "Hello " & varx_Firstname & "," & "</p>"
strText2 = strText2 & "Your following Ad at www.mydomain.com has been Approved." & "</p>"
strText2 = strText2 & "This email is for your records.  You do not need to reply back to this email." & "</p>"
strText2 = strText2 & "Ad ID: " & varAd_ID & "<br>" 
strText2 = strText2 & "Ad Category: " & varAd_Category & "<br>" 
strText2 = strText2 & "Ad City: " & varAd_City & "<br>"
strText2 = strText2 & "Ad State: " & varAd_State & "<br>" 
strText2 = strText2 & "Ad Country: " & varAd_Country & "</p>"
strText2 = strText2 & "Your Account Login Name: " & varUserName & "<br>"
strText2 = strText2 & "Your Account First Name: " & varx_Firstname & "<br>"
strText2 = strText2 & "Your Account Last Name: " & varx_Lastname & "</p>"
strText2 = strText2 & "Best Regards," & "<br>"
strText2 = strText2 & "The Team at www.mydomain.com" & "<br>"
strText2 = strText2 & "</td></tr></table>" & VbCrLf 
strText2 = strText2 & "</body></html>" & VbCrLf

call sendEmail("me@mydomain.com","me@mydomain.com","Ad Approved",strText)
call sendEmail("me@mydomain.com",varx_Email,"Your Ad at www.mydomain.com",strText2)%>

<%
FUNCTION sendEmail(myMailFrom,myMailTo,myMailSubject,strText)
Const cdoSendUsingPort = 2
Const strSmartHost = "localhost"

Set myMail = CreateObject("CDO.Message")
Set iConf = myMail.Configuration
	
With iConf.Fields
	.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
	.Update
End With

With iConf.Fields
	.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
	.Update
End With

With myMail
	myMail.From = myMailFrom
	myMail.To = myMailTo
	myMail.Subject = myMailSubject
	myMail.HTMLBody = strText
	myMail.Send
End With


Set myMail = Nothing
END FUNCTION
%>




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 23:49:50)

You're absolutely correct. I put those in to see if that was going to make a difference when I wasn't getting all the correct values returned in my CDOSYS email and I forgot to remove all of them except Ad_ID.

I've cleared those out now but Ad_ID is still only the correct value being returned in the CDOSYS email. The other values being returned are session values of myself being logged into SL as Admin doing the update to the record.




Spooky -> RE: Change CDOSYS Session Values to DB Values (5/27/2006 23:52:34)

That tells me you are either running the wrong code or the host is caching your asp pages?
Theres certainly nothing in the code provided that shows that?




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/28/2006 11:50:01)

I apologize in advance for the horizontal scrolling in this message. Please let me know how to post without causing horizontal scrolling.

I'm not exactly sure what the problem is. I'm suspecting it has something to do with the fact that this "Update" is a two page process, and I was not passing all my values from the first page to the page where the CDOSYS script is, which is the page that performs the posting for the update. Hope I made sense articulating that.

So, I went back and modified my first page, Ad_Approve.asp which DRWs and then passes to Ad_Approve_Confirmation.asp which posts the update and also has the CDOSYS code embedded in it.

After making those changes, the update won't post at all UNLESS I remove the CDOSYS code. The Ad_Approve_Confirmation.asp page errors if the CDOSYS code is in it.

If you could please take a look at both of my pages that I use for this update process, I would greatly appreciate it.

Here's the code for both pages.

I apologize again for the horizontal scrolling; I haven't figured out how to paste into the forum using the nice scrolling text box. Please let me know how I can do that. Thanks.

THE FIRST PAGE (Ad_Approve.asp):

<% 
If Session("UserName")&"" = "" Then 
Response.redirect "/Account_Login.asp?Redirect=" &Request.Servervariables("URL")
End if 
%>

<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_LCID = 1033 %>
<meta http-equiv="Content-Language" content="en-us">
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<style fprolloverstyle>A:hover {font-family: Arial; color: #CC0000}
</style>

</head>

<body leftMargin="0" topMargin="6" marginwidth="0" marginheight="0" rightmargin="0" bottommargin="0" alink="#CC0000" vlink="#145C9E" text="#000000" link="#145C9E">

<p style="margin-top: 0; margin-bottom: 0">
<iframe name="I1" scrolling="no" align="center" border="0" frameborder="0" height="60" width="766" src="Support%20Pages/Header.htm" marginwidth="3" marginheight="0">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe></p>
<div align="center">
	<table border="0" cellpadding="0" style="border-collapse: collapse" width="766" height="15">
		<tr>
			<td valign="top">
			<p style="margin-top: 0; margin-bottom: 0"><!--** START NAVSTUDIO MENU TAGS (461269) **-->
			<p align="center" style="margin-top: 0; margin-bottom: 0"><div id="vqp_about" style="position:absolute;visibility:hidden;">
				<p style="margin-top: 0; margin-bottom: 0">****JavaScript based drop down DHTML menu generated by NavStudio. (OpenCube Inc. - http://www.opencube.com)****</div>
<script language="JavaScript" vqptag="doc_level_settings" vqp_datafile0="Menu.js" vqp_uid0=461269>cdd__codebase = "";cdd__codebase461269 = "";</script>
<script language="JavaScript" vqptag="datafile" src="Menu.js"></script><script vqptag="placement" vqp_menuid="461269" language="JavaScript">create_menu(461269)</script>
<!--** END NAVSTUDIO MENU TAGS **-->
</td></tr>
	</table>
</div><div align="center">
	<table border="0" cellpadding="0" style="border-collapse: collapse" width="766">
		<tr>
			<td width="600" height="150" align="center" valign="top">
			<p align="center" style="margin-top: 0; margin-bottom: 0">
			<iframe name="I3" src="Support%20Pages/Top.htm" marginwidth="1" marginheight="1" height="177" width="600" scrolling="no" border="0" frameborder="0">
			Your browser does not support inline frames or is currently configured not to display inline frames.
			</iframe></p></td>
			<td width="5" height="150"> </td>
			<td width="161" height="150" valign="top" bgcolor="#F5F4EE" align="center"><p style="margin-top: 0; margin-bottom: 5px">
			<iframe name="I4" src="Support%20Pages/Breakout%201.htm" marginwidth="1" marginheight="1" height="177" width="155" scrolling="no" border="0" frameborder="0">
			Your browser does not support inline frames or is currently configured not to display inline frames.
			</iframe></p></td>
		</tr>
		<tr>
			<td width="600" valign="top" height="7">
			<p style="margin-top: 0; margin-bottom: 0">
			<img border="0" src="Images/Blue%20Fade.gif" width="600" height="7"></td>
			<td width="5" height="7" valign="top">
			<p style="margin-top: 0; margin-bottom: 0"></td>
			<td width="161" valign="top" height="7">
			<p style="margin-top: 0; margin-bottom: 0">
			<img border="0" src="Images/Blue%20Fade%202.gif" width="161" height="7"></td>
		</tr>
		<tr>
			<td width="600" height="10" valign="top">
			<p style="margin-top: 0; margin-bottom: -3px">
			<img border="0" src="Images/feather%20-%20blue.gif" width="57" height="11" vspace="2" align="middle"><font face="Arial Black" color="#000080">
			</font></p>
			<p style="margin-top: 0; margin-bottom: 0">
			<font face="Arial Black" color="#CC0000">
			<span style="font-size: 11pt">Ad Approve</span></font><font face="Arial Black" color="#000080"><img border="0" src="Images/title_line%20-%20blue.gif" width="159" height="8"></font><p style="margin-top: 0; margin-bottom: 0">
			 <p style="margin-top: 0; margin-bottom: 0">
			 <p style="margin-top: 0; margin-bottom: 0">
			<b><font face="Arial" size="2" color="#145C9E">Hello
    <%=Session(appName&"x_firstname")%>!  </font></b>
			<font color="#145C9E" face="Arial" size="2">Are you ready to Approve 
			this Ad now?</font><!--webbot bot="DatabaseRegionStart" s-columnnames="UserID,UserName,Password,x_Firstname,x_Lastname,x_Country,x_City,x_Email,Advertiser_ID,Action_Last,Action_Last_Date,Action_Last_UserID,Action_History,Action_History_Date,Action_History_UserID,Disposition,Ad_Status,Ad_ID,Ad_Country,Ad_State,Ad_City,Ad_Category,Ad_Category_Details,Business_or_Individual,Company_Name,Individual_Name,Company_Formed,Business_Hours,Business_Address,Business_Country,Business_State,Business_City,Business_Zip_Code,Service_Type,Service_Details,Service_Area,Service_Qualifications,Service_Degrees_Certifications,Service_References,Rates,Payment_Terms,Payment_Accepted,Payment_Accepted_Comments,Contact_First_Name,Contact_Last_Name,Contact_Country,Contact_State,Contact_City,Contact_Zip_Code,Contact_Phone_1,Contact_Phone_2,Contact_Pager,Contact_Pager_PIN,Contact_Email,Contact_IM,Contact_Website,Contact_Time,Terms_Of_Use,Remote_computer_name,User_name,Browser_type,Timestamp,FileName" s-columntypes="3,202,202,202,202,202,202,202,202,202,135,202,203,203,203,202,202,3,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,135,202" s-dataconnection="Signup" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="FALSE" i-listformat="7" b-makeform="FALSE" s-recordsource="Ads" s-displaycolumns="Ad_ID,Ad_Status,Action_Last,Disposition,Action_Last_Date,Action_Last_UserID,Action_History,Action_History_Date,Action_History_UserID,Ad_Category,Ad_City,Ad_State,Ad_Country,UserID,UserName,x_Firstname,x_Lastname,x_Email" s-criteria="{Ad_ID} EQ {Ad_ID} +" s-order s-sql="SELECT * FROM Ads WHERE (Ad_ID =  ::Ad_ID::)" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="Ad_ID=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr></table>" startspan --><!--#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 Ads WHERE (Ad_ID =  ::Ad_ID::)"
fp_sDefault="Ad_ID="
fp_sNoRecords="No records returned."
fp_sDataConn="Signup"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&UserID=3&UserName=202&Password=202&x_Firstname=202&x_Lastname=202&x_Country=202&x_City=202&x_Email=202&Advertiser_ID=202&Action_Last=202&Action_Last_Date=135&Action_Last_UserID=202&Action_History=203&Action_History_Date=203&Action_History_UserID=203&Disposition=202&Ad_Status=202&Ad_ID=3&Ad_Country=202&Ad_State=202&Ad_City=202&Ad_Category=202&Ad_Category_Details=202&Business_or_Individual=202&Company_Name=202&Individual_Name=202&Company_Formed=202&Business_Hours=202&Business_Address=202&Business_Country=202&Business_State=202&Business_City=202&Business_Zip_Code=202&Service_Type=202&Service_Details=202&Service_Area=202&Service_Qualifications=202&Service_Degrees_Certifications=202&Service_References=202&Rates=202&Payment_Terms=202&Payment_Accepted=202&Payment_Accepted_Comments=202&Contact_First_Name=202&Contact_Last_Name=202&Contact_Country=202&Contact_State=202&Contact_City=202&Contact_Zip_Code=202&Contact_Phone_1=202&Contact_Phone_2=202&Contact_Pager=202&Contact_Pager_PIN=202&Contact_Email=202&Contact_IM=202&Contact_Website=202&Contact_Time=202&Terms_Of_Use=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&FileName=202&"
fp_iDisplayCols=18
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="7794" --><form METHOD="POST" action="Ad_Approve_Confirmation9.asp">
				<!--webbot bot="PurpleText" preview="Set this form's properties so it submits user input to the appropriate page." --><table BORDER="0">
					<tr>
						<td><br>
						<input TYPE="submit" NAME="fp_submit" value="Approve Ad Now"></td>
					</tr>
				</table>
				<input type="hidden" name="Action_History" value="<%=FP_FieldHTML(fp_rs,"Action_History") & ", " & ("Approved")%>">
				<input type="hidden" name="Action_History_Date" value="<%=FP_FieldHTML(fp_rs,"Action_History_Date") & ", " & NOW()%>">
				<input type="hidden" name="Action_History_UserID" value="<%=FP_FieldHTML(fp_rs,"Action_History_UserID") & ", " & Session("UserID")%>">
				<input type="hidden" name="Action_Last" value="Approved">
				<input type="hidden" name="Action_Last_Date" value="<%=NOW()%>">
				<input type="hidden" name="Action_Last_UserID" value="<%=Session("UserID")%>">
				<input type="hidden" name="Ad_ID" value="<%=FP_FieldHTML(fp_rs,"Ad_ID")%>">
				<input type="hidden" name="Ad_Status" value="Active">
				<input type="hidden" name="Disposition" value="Approved">
				<input type="hidden" name="Ad_Category" value="<%=FP_FieldHTML(fp_rs,"Ad_Category")%>">
				<input type="hidden" name="Ad_City" value="<%=FP_FieldHTML(fp_rs,"Ad_City")%>">
				<input type="hidden" name="Ad_State" value="<%=FP_FieldHTML(fp_rs,"Ad_State")%>">
				<input type="hidden" name="Ad_Country" value="<%=FP_FieldHTML(fp_rs,"Ad_Country")%>">
				<input type="hidden" name="UserID" value="<%=FP_FieldHTML(fp_rs,"UserID")%>">
				<input type="hidden" name="UserName" value="<%=FP_FieldHTML(fp_rs,"UserName")%>">
				<input type="hidden" name="x_Firstname" value="<%=FP_FieldHTML(fp_rs,"x_Firstname")%>">
				<input type="hidden" name="x_Lastname" value="<%=FP_FieldHTML(fp_rs,"x_Lastname")%>">
				<input type="hidden" name="x_Email" value="<%=FP_FieldHTML(fp_rs,"x_Email")%>">
				

			</form>
			<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the end of a Database Results region.</font></td></tr></table>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --><p style="margin-top: 0; margin-bottom: 0">
			 <p style="margin-top: 0; margin-bottom: 0">
			 </td>
			<td width="5" height="63"> </td>
			<td width="161" height="63" valign="top" bgcolor="#F5F4EE" align="center">
			<p style="margin-top: 3px; margin-bottom: 0"><font face="Arial">
						<b>
			<iframe name="I5" src="Support%20Pages/Breakout%202.htm" marginwidth="1" marginheight="1" height="300" width="155" scrolling="no" border="0" frameborder="0">
			Your browser does not support inline frames or is currently configured not to display inline frames.
			</iframe></b></font></p>
			<p> </p>
			<p> </td>
		</tr>
		</table>

<p style="margin-top: 0; margin-bottom: 0" align="center">
<font face="Arial" style="font-size: 9pt" color="#0000FF">
<font color="#145C9E"><</font><a style="text-decoration: none" href="#Top">Return To Top Of Page</a><font color="#145C9E">></font></font></p>
</div>
<p style="margin-top: 4px; margin-bottom: 0">
<iframe name="I2" marginwidth="3" marginheight="0" height="94" width="766" scrolling="no" align="center" border="0" frameborder="0" src="Support%20Pages/Footer.htm">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe></p>

</script>

</SCRIPT>

<SCRIPT language=javascript>
function mailpage()
{
mail_str = "mailto:?subject=A Great Website!";
mail_str += "&body=Hey, I thought you might be interested in this great website.";
mail_str += " You can view it at, " + location.href; 
location.href = mail_str;
}
    </SCRIPT>


</SCRIPT>

<SCRIPT language=javascript>
function mailpage()
{
mail_str = "mailto:?subject=Ad Photo and Resume For (Your Name)";
mail_str += "&body=Send this email to CustomerService@mydomain.com.  PLEASE BE SURE TO ATTACH YOUR PHOTO AND/OR YOUR RESUME AND INCLUDE YOUR NAME IN THE EMAIL SUBJECT FIELD.";
; 
location.href = mail_str;
}
    </SCRIPT>
			</u>

</html>


THE SECOND PAGE WITH CODOSYS CODE (Ad_Approve_Confirmation.asp):
<html>

<head>
<title>New Page 1</title>
	<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
	<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_LCID = 1033 %>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<style fprolloverstyle>A:hover {font-family: Arial; color: #CC0000}
</style>

</head>

<body leftMargin="0" topMargin="6" marginwidth="0" marginheight="0" rightmargin="0" bottommargin="0" alink="#CC0000" vlink="#145C9E" text="#000000" link="#145C9E">

<p style="margin-top: 0; margin-bottom: 0">
<iframe name="I1" scrolling="no" align="center" border="0" frameborder="0" height="60" width="766" src="Support%20Pages/Header.htm" marginwidth="3" marginheight="0">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe></p>
<div align="center">
	<table border="0" cellpadding="0" style="border-collapse: collapse" width="766" height="15">
		<tr>
			<td valign="top">
			<p style="margin-top: 0; margin-bottom: 0"><!--** START NAVSTUDIO MENU TAGS (461269) **-->
			<p align="center" style="margin-top: 0; margin-bottom: 0"><div id="vqp_about" style="position:absolute;visibility:hidden;">
				<p style="margin-top: 0; margin-bottom: 0">****JavaScript based drop down DHTML menu generated by NavStudio. (OpenCube Inc. - http://www.opencube.com)****</div>
<script language="JavaScript" vqptag="doc_level_settings" vqp_datafile0="Menu.js" vqp_uid0=461269>cdd__codebase = "";cdd__codebase461269 = "";</script>
<script language="JavaScript" vqptag="datafile" src="Menu.js"></script><script vqptag="placement" vqp_menuid="461269" language="JavaScript">create_menu(461269)</script>
<!--** END NAVSTUDIO MENU TAGS **-->
</td></tr>
	</table>
</div><div align="center">
	<table border="0" cellpadding="0" style="border-collapse: collapse" width="766">
		<tr>
			<td width="600" height="150" align="center" valign="top">
			<p align="center" style="margin-top: 0; margin-bottom: 0">
			<iframe name="I3" src="Support%20Pages/Top.htm" marginwidth="1" marginheight="1" height="177" width="600" scrolling="no" border="0" frameborder="0">
			Your browser does not support inline frames or is currently configured not to display inline frames.
			</iframe></p></td>
			<td width="5" height="150"> </td>
			<td width="161" height="150" valign="top" bgcolor="#F5F4EE" align="center"><p style="margin-top: 0; margin-bottom: 5px">
			<iframe name="I4" src="Support%20Pages/Breakout%201.htm" marginwidth="1" marginheight="1" height="177" width="155" scrolling="no" border="0" frameborder="0">
			Your browser does not support inline frames or is currently configured not to display inline frames.
			</iframe></p></td>
		</tr>
		<tr>
			<td width="600" valign="top" height="7">
			<p style="margin-top: 0; margin-bottom: 0">
			<img border="0" src="Images/Blue%20Fade.gif" width="600" height="7"></td>
			<td width="5" height="7" valign="top">
			<p style="margin-top: 0; margin-bottom: 0"></td>
			<td width="161" valign="top" height="7">
			<p style="margin-top: 0; margin-bottom: 0">
			<img border="0" src="Images/Blue%20Fade%202.gif" width="161" height="7"></td>
		</tr>
		<tr>
			<td width="600" height="10" valign="top">
			<p style="margin-top: 0; margin-bottom: -3px">
			<img border="0" src="Images/feather%20-%20blue.gif" width="57" height="11" vspace="2" align="middle"><font face="Arial Black" color="#000080">
			</font></p>
			<p style="margin-top: 0; margin-bottom: 0">
			<font face="Arial Black" color="#CC0000">
			<span style="font-size: 11pt">Ad Approve Confirmation</span></font><font face="Arial Black" color="#000080"><img border="0" src="Images/title_line%20-%20blue.gif" width="159" height="8"></font></td>
			<td width="5" height="63" rowspan="2"> </td>
			<td width="161" height="63" rowspan="2" valign="top" bgcolor="#F5F4EE" align="center">
			<p style="margin-top: 3px; margin-bottom: 0"><font face="Arial">
						<b>
			<iframe name="I5" src="Support%20Pages/Breakout%202.htm" marginwidth="1" marginheight="1" height="300" width="155" scrolling="no" border="0" frameborder="0">
			Your browser does not support inline frames or is currently configured not to display inline frames.
			</iframe></b></font></p>
			<p> </p>
			<p> </td>
		</tr>
		<tr>
			<td width="600" height="250" valign="top">
			<p class="MsoNormal" style="text-align: justify; margin-top: 0; margin-bottom: 0">
     </p>
			<p class="MsoNormal" style="text-align: justify; margin-top: 0; margin-bottom: 0">
    <b><font color="#145C9E" face="Arial" size="2">Thank You
    <%=Session(appName&"x_firstname")%>!
    </font>  	
    </b>
    </p>
			<p class="MsoNormal" style="text-align: justify; margin-top: 0; margin-bottom: 0">
     </p>
			<p class="MsoNormal" style="text-align: justify; margin-top: 0; margin-bottom: 0">
    <font face="Arial" size="2" color="#145C9E">This Ad has been successfully 
	Approved.  
	You may return to the <a target="_parent" href="admin_ads.asp">Account 
	Management Center</a> and confirm the Approval you made to this Ad by 
	locating the specific Ad you Approved in the blue table titled "Ads Approved</font><span style="font-size: 9pt; color: #145c9e; font-family: Arial"><font face="Arial" size="2">"</font></span><font color="#145C9E" face="Arial" size="2">.
    </font>
    <font color="#145C9E">
    </b>
    </font>
    </p>
			<body>
			<p class="MsoNormal" style="text-align: justify; margin-top: 0; margin-bottom: 0">
    <body>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

</p>

<!--webbot bot="DatabaseRegionStart" s-columnnames="FileName,Timestamp,Browser_type,User_name,Remote_computer_name,Terms_Of_Use,Contact_Time,Contact_Website,Contact_IM,Contact_Email,Contact_Pager_PIN,Contact_Pager,Contact_Phone_2,Contact_Phone_1,Contact_Zip_Code,Contact_City,Contact_State,Contact_Country,Contact_Last_Name,Contact_First_Name,Payment_Accepted_Comments,Payment_Accepted,Payment_Terms,Rates,Service_References,Service_Degrees_Certifications,Service_Qualifications,Service_Area,Service_Details,Service_Type,Business_Zip_Code,Business_City,Business_State,Business_Country,Business_Address,Business_Hours,Company_Formed,Individual_Name,Company_Name,Business_or_Individual,Ad_Category_Details,Ad_Category,Ad_City,Ad_State,Ad_Country,Ad_ID,Ad_Status,Disposition,Action_History_UserID,Action_History_Date,Action_History,Action_Last_UserID,Action_Last_Date,Action_Last,Advertiser_ID,x_Email,x_City,x_Country,x_Lastname,x_Firstname,Password,UserName,UserID" s-columntypes="202,135,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,3,202,202,203,203,203,202,135,202,202,202,202,202,202,202,202,202,3" s-dataconnection="Signup" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="FALSE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="7" b-makeform="FALSE" s-recordsource s-displaycolumns s-criteria s-order s-sql="UPDATE Ads SET Ad_Category = ::Ad_Category::, Ad_City = ::Ad_City::, Ad_State = ::Ad_State::, Ad_Country = ::Ad_Country::, UserID = ::UserID::, UserName = ::UserName::, x_Firstname = ::x_Firstname::, x_Lastname = ::x_Lastname::, x_Email = ::x_Email::, Action_Last = ::Action_Last::, Action_Last_Date = ::Action_Last_Date::, Action_Last_UserID = ::Action_Last_UserID::, Action_History = ::Action_History::, Action_History_Date = ::Action_History_Date::, Action_History_UserID = ::Action_History_UserID::, Disposition = ::Disposition::, Ad_Status = '::Ad_Status::' WHERE Ad_ID = ::Ad_ID::" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="Ad_Category=&Ad_City=&Ad_State=&Ad_Country=&UserID=&UserName=&x_Firstname=&x_Lastname=&x_Email=&Action_Last=&Action_Last_Date=&Action_Last_UserID=&Action_History=&Action_History_Date=&Action_History_UserID=&Disposition=&Ad_Status=&Ad_ID=" s-norecordsfound i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr></table>" startspan --><!--#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="UPDATE Ads SET Ad_Category = ::Ad_Category::, Ad_City = ::Ad_City::, Ad_State = ::Ad_State::, Ad_Country = ::Ad_Country::, UserID = ::UserID::, UserName = ::UserName::, x_Firstname = ::x_Firstname::, x_Lastname = ::x_Lastname::, x_Email = ::x_Email::, Action_Last = ::Action_Last::, Action_Last_Date = ::Action_Last_Date::, Action_Last_UserID = ::Action_Last_UserID::, Action_History = ::Action_History::, Action_History_Date = ::Action_History_Date::, Action_History_UserID = ::Action_History_UserID::, Disposition = ::Disposition::, Ad_Status = '::Ad_Status::' WHERE Ad_ID = ::Ad_ID::"
fp_sDefault="Ad_Category=&Ad_City=&Ad_State=&Ad_Country=&UserID=&UserName=&x_Firstname=&x_Lastname=&x_Email=&Action_Last=&Action_Last_Date=&Action_Last_UserID=&Action_History=&Action_History_Date=&Action_History_UserID=&Disposition=&Ad_Status=&Ad_ID="
fp_sNoRecords=""
fp_sDataConn="Signup"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&FileName=202&Timestamp=135&Browser_type=202&User_name=202&Remote_computer_name=202&Terms_Of_Use=202&Contact_Time=202&Contact_Website=202&Contact_IM=202&Contact_Email=202&Contact_Pager_PIN=202&Contact_Pager=202&Contact_Phone_2=202&Contact_Phone_1=202&Contact_Zip_Code=202&Contact_City=202&Contact_State=202&Contact_Country=202&Contact_Last_Name=202&Contact_First_Name=202&Payment_Accepted_Comments=202&Payment_Accepted=202&Payment_Terms=202&Rates=202&Service_References=202&Service_Degrees_Certifications=202&Service_Qualifications=202&Service_Area=202&Service_Details=202&Service_Type=202&Business_Zip_Code=202&Business_City=202&Business_State=202&Business_Country=202&Business_Address=202&Business_Hours=202&Company_Formed=202&Individual_Name=202&Company_Name=202&Business_or_Individual=202&Ad_Category_Details=202&Ad_Category=202&Ad_City=202&Ad_State=202&Ad_Country=202&Ad_ID=3&Ad_Status=202&Disposition=202&Action_History_UserID=203&Action_History_Date=203&Action_History=203&Action_Last_UserID=202&Action_Last_Date=135&Action_Last=202&Advertiser_ID=202&x_Email=202&x_City=202&x_Country=202&x_Lastname=202&x_Firstname=202&Password=202&UserName=202&UserID=3&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="9773" --><form METHOD="POST">
	<!--webbot bot="PurpleText" preview="Set this form's properties so it submits user input to the appropriate page." --><table BORDER="0">
		<tr>
			<td COLSPAN="2"><br>
			<input TYPE="Submit" NAME="fp_submit"><input TYPE="Reset" NAME="fp_reset"></td>
		</tr>
	</table>

<% 
varAd_ID = FP_FieldVal(fp_rs,"Ad_ID") 
varAd_Category = FP_FieldVal(fp_rs,"Ad_Category") 
varAd_City = FP_FieldVal(fp_rs,"Ad_City") 
varAd_State = FP_FieldVal(fp_rs,"Ad_State") 
varAd_Country = FP_FieldVal(fp_rs,"Ad_Country") 
varUserID = FP_FieldVal(fp_rs,"UserID") 
varUserName = FP_FieldVal(fp_rs,"UserName")
varx_Firstname = FP_FieldVal(fp_rs,"x_Firstname") 
varx_Lastname = FP_FieldVal(fp_rs,"x_Lastname") 
varx_Email = FP_FieldVal(fp_rs,"x_Email") 
%>

</form>
<hr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the end of a Database Results region.</font></td></tr></table>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" -->
</p>
			<body>

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

<p style="margin-top: 0; margin-bottom: 0" align="center">
<font face="Arial" style="font-size: 9pt" color="#0000FF">
<font color="#145C9E"><</font><a style="text-decoration: none" href="#Top">Return To Top Of Page</a><font color="#145C9E">></font></font></p>
</div>
<p style="margin-top: 4px; margin-bottom: 0">
<iframe name="I2" marginwidth="3" marginheight="0" height="94" width="766" scrolling="no" align="center" border="0" frameborder="0" src="Support%20Pages/Footer.htm">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe></p>

</script>

</SCRIPT>

<SCRIPT language=javascript>
function mailpage()
{
mail_str = "mailto:?subject=A Great Website!";
mail_str += "&body=Hey, I thought you might be interested in this great website.";
mail_str += " You can view it at, " + location.href; 
location.href = mail_str;
}
    </SCRIPT>

<%DIM strText 

strText = "" 
strText = strText & "<html>" & VbCrLf 
strText = strText & "<body>" & VbCrLf 
strText = strText & "<table>" & VbCrLf 
strText = strText & "<tr><td>" & VbCrLf 
strText = strText & "Hello Evan," & "</p>"
strText = strText & "The following Ad has been Approved." & "</p>"
strText = strText & "Ad ID: " & varAd_ID & "<br>" 
strText = strText & "Ad Category: " & varAd_Category & "<br>" 
strText = strText & "Ad City: " & varAd_City & "<br>"
strText = strText & "Ad State: " & varAd_State & "<br>" 
strText = strText & "Ad Country: " & varAd_Country & "</p>" 
strText = strText & "Account ID: " & varUserID & "<br>"
strText = strText & "Account Login Name: " & varUserName & "<br>"
strText = strText & "Account First Name: " & varx_Firstname & "<br>"
strText = strText & "Account Last Name: " & varx_Lastname & "<br>"
strText = strText & "</td></tr></table>" & VbCrLf 
strText = strText & "</body></html>" & VbCrLf 

DIM strText2

strText2 = "" 
strText2 = strText2 & "<html>" & VbCrLf 
strText2 = strText2 & "<body>" & VbCrLf 
strText2 = strText2 & "<table>" & VbCrLf 
strText2 = strText2 & "<tr><td>" & VbCrLf 
strText2 = strText2 & "Hello " & varx_Firstname & "," & "</p>"
strText2 = strText2 & "Your following Ad at www.mydomain.com has been Approved.  Congratulations!  This means your Ad is now live & visible to tens of thousands of potential customers." & "</p>"
strText2 = strText2 & "This email is for your records.  You do not need to reply back to this email." & "</p>"
strText2 = strText2 & "Ad ID: " & varAd_ID & "<br>" 
strText2 = strText2 & "Ad Category: " & varAd_Category & "<br>" 
strText2 = strText2 & "Ad City: " & varAd_City & "<br>"
strText2 = strText2 & "Ad State: " & varAd_State & "<br>" 
strText2 = strText2 & "Ad Country: " & varAd_Country & "</p>"
strText2 = strText2 & "Your Account Login Name: " & varUserName & "<br>"
strText2 = strText2 & "Your Account First Name: " & varx_Firstname & "<br>"
strText2 = strText2 & "Your Account Last Name: " & varx_Lastname & "</p>"
strText2 = strText2 & "Thank you very much for advertising on mydomain.com.  We will be working hard every day to ensure that you find our services to be very helpful and beneficial in the advertising of your services.  We sincerely hope to have the opportunity to be a part of all of your advertising strategies and wish you great success in all your endeavors." & "</p>"
strText2 = strText2 & "We sincerely hope to have the opportunity to be a part of all of your advertising strategies and wish you great success in all your endeavors." & "</p>"
strText2 = strText2 & "If you have any questions at all, please feel free to contact us." & "</p>"
strText2 = strText2 & "Best Regards," & "<br>"
strText2 = strText2 & "The Team at www.mydomain.com" & "<br>"
strText2 = strText2 & "</td></tr></table>" & VbCrLf 
strText2 = strText2 & "</body></html>" & VbCrLf

call sendEmail("me@mydomain.com","me@mydomain.com","Ad Approved",strText)
call sendEmail("me@mydomain.com",varx_Email,"Your Ad at www.mydomain.com",strText2)%>

<%
FUNCTION 
sendEmail(myMailFrom,myMailTo,myMailSubject,strText)
Const cdoSendUsingPort = 2
Const strSmartHost = "localhost"

Set myMail = CreateObject("CDO.Message")
Set iConf = myMail.Configuration
	
With iConf.Fields
	.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
	.Update
End With

With iConf.Fields
	.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
	.Update
End With

With myMail
	myMail.From = myMailFrom
	myMail.To = myMailTo
	myMail.Subject = myMailSubject
	myMail.HTMLBody = strText
	myMail.Send
End With


Set myMail = Nothing
END FUNCTION
%>

</html>







BeTheBall -> RE: Change CDOSYS Session Values to DB Values (5/28/2006 13:03:02)

To stop the horizontal scrolling, once you paste in your code, highlight it witht he cursor and then click the button that looks like this: <%

As for your pages. First of all, this block of code:

<% 
varAd_ID = FP_FieldVal(fp_rs,"Ad_ID") 
varAd_Category = FP_FieldVal(fp_rs,"Ad_Category") 
varAd_City = FP_FieldVal(fp_rs,"Ad_City") 
varAd_State = FP_FieldVal(fp_rs,"Ad_State") 
varAd_Country = FP_FieldVal(fp_rs,"Ad_Country") 
varUserID = FP_FieldVal(fp_rs,"UserID") 
varUserName = FP_FieldVal(fp_rs,"UserName")
varx_Firstname = FP_FieldVal(fp_rs,"x_Firstname") 
varx_Lastname = FP_FieldVal(fp_rs,"x_Lastname") 
varx_Email = FP_FieldVal(fp_rs,"x_Email") 
%>


will not work because there is no select query. However, since you queried the database on the previous page and put the values in hidden form fields, you should be able to access them via Request.Form. I am not sure I understand what is supposed to be happening here. The user submits the form on page one and goes to page two. Is that when the email is supposed to generate? I guess I don't understand the purpose of the submit button on the confirmation page. What is supposed to happen when they click that button?




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/28/2006 13:15:42)

Thanks for the info Duane. To answer your question, let me explain how page two works.

Actually, the submit button you're seeing on page 2, the user never even sees that. It was part of the DRW that I never took out. That page has been functioning fine with that button in there so I just left it, and again, the user never even sees that button.

The email gets generated when the user automatically advances to page two and page two also performs the post of the update to the DB.

How would I change the varAd_ID = FP_FieldVal(fp_rs,"Ad_ID"), for example, to reflect the Request.Form code you mentioned? What would that look like and would that block of code still remain where I have it on that page? Also, how would Request.Form change how I reference varAd_ID and the other var lines in the CDOSYS code?




BeTheBall -> RE: Change CDOSYS Session Values to DB Values (5/28/2006 16:42:02)

You won't even need to create variables, just use the request.form objects in your script. For example, this line:

strText = strText & "Ad Category: " & varAd_Category & "<br>"

would become:

strText = strText & "Ad Category: " & Request.Form("Ad_Category") & "<br>"




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/28/2006 18:40:34)

Thanks Duane. I made the changes but unfortunately, it still didn't work. Perhaps I missed changing something or changed it incorrectly. Here's what I did.

I removed the whole block of code:
<%

varAd_ID = FP_FieldVal(fp_rs,"Ad_ID")
varAd_Category = FP_FieldVal(fp_rs,"Ad_Category")
varAd_City = FP_FieldVal(fp_rs,"Ad_City")
varAd_State = FP_FieldVal(fp_rs,"Ad_State")
varAd_Country = FP_FieldVal(fp_rs,"Ad_Country")
varUserID = FP_FieldVal(fp_rs,"UserID")
varUserName = FP_FieldVal(fp_rs,"UserName")
varx_Firstname = FP_FieldVal(fp_rs,"x_Firstname")
varx_Lastname = FP_FieldVal(fp_rs,"x_Lastname")
varx_Email = FP_FieldVal(fp_rs,"x_Email")
%>

I changed all var references in the CDOSYS code so my CDOSYS code now looks like:

<%
DIM strText 

strText = "" 
strText = strText & "<html>" & VbCrLf 
strText = strText & "<body>" & VbCrLf 
strText = strText & "<table>" & VbCrLf 
strText = strText & "<tr><td>" & VbCrLf 
strText = strText & "Hello Evan," & "</p>"
strText = strText & "The following Ad has been Approved." & "</p>"
strText = strText & "Ad ID: " & Request.Form("Ad_ID") & "<br>" 
strText = strText & "Ad Category: " & Request.Form("Ad_Category") & "<br>"
strText = strText & "Ad City: " & Request.Form("Ad_City") & "<br>"
strText = strText & "Ad State: " & Request.Form("Ad_State") & "<br>" 
strText = strText & "Ad Country: " & Request.Form("Ad_Country") & "</p>" 
strText = strText & "Account ID: " & Request.Form("UserID") & "<br>"
strText = strText & "Account Login Name: " & Request.Form("UserName") & "<br>"
strText = strText & "Account First Name: " & Request.Form("x_Firstname") & "<br>"
strText = strText & "Account Last Name: " & Request.Form("x_Lastname") & "<br>"
strText = strText & "</td></tr></table>" & VbCrLf 
strText = strText & "</body></html>" & VbCrLf 

DIM strText2

strText2 = "" 
strText2 = strText2 & "<html>" & VbCrLf 
strText2 = strText2 & "<body>" & VbCrLf 
strText2 = strText2 & "<table>" & VbCrLf 
strText2 = strText2 & "<tr><td>" & VbCrLf 
strText2 = strText2 & "Hello " & User & "," & "</p>"
strText2 = strText2 & "Your following Ad at www.mydomain.com has been Approved.  Congratulations!  This means your Ad is now live & visible to tens of thousands of potential customers." & "</p>"
strText2 = strText2 & "This email is for your records.  You do not need to reply back to this email." & "</p>"
strText2 = strText2 & "Ad ID: " & Request.Form("Ad_ID") & "<br>" 
strText2 = strText2 & "Ad Category: " & Request.Form("Ad_Category") & "<br>" 
strText2 = strText2 & "Ad City: " & Request.Form("Ad_City") & "<br>"
strText2 = strText2 & "Ad State: " & Request.Form("Ad_State") & "<br>" 
strText2 = strText2 & "Ad Country: " & Request.Form("Ad_Country") & "</p>"
strText2 = strText2 & "Your Account Login Name: " & Request.Form("UserName") & "<br>"
strText2 = strText2 & "Your Account First Name: " & Request.Form("x_Firstname") & "<br>"
strText2 = strText2 & "Your Account Last Name: " & Request.Form("x_Lastname") & "</p>"
strText2 = strText2 & "Thank you very much for advertising on mydomain.com.  We will be working hard every day to ensure that you find our services to be very helpful and beneficial in the advertising of your services.  We sincerely hope to have the opportunity to be a part of all of your advertising strategies and wish you great success in all your endeavors." & "</p>"
strText2 = strText2 & "We sincerely hope to have the opportunity to be a part of all of your advertising strategies and wish you great success in all your endeavors." & "</p>"
strText2 = strText2 & "If you have any questions at all, please feel free to contact us." & "</p>"
strText2 = strText2 & "Best Regards," & "<br>"
strText2 = strText2 & "The Team at www.mydomain.com" & "<br>"
strText2 = strText2 & "</td></tr></table>" & VbCrLf 
strText2 = strText2 & "</body></html>" & VbCrLf

call sendEmail("me@mydomain.com","me@mydomain.com","Ad Approved",strText)
call sendEmail("me@mydomain.com",Request.Form("x_Email"),"Your Ad at www.mydomain.com",strText2)
%>

<%
FUNCTION 
sendEmail(myMailFrom,myMailTo,myMailSubject,strText)
Const cdoSendUsingPort = 2
Const strSmartHost = "localhost"

Set myMail = CreateObject("CDO.Message")
Set iConf = myMail.Configuration
	
With iConf.Fields
	.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
	.Update
End With

With iConf.Fields
	.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
	.Update
End With

With myMail
	myMail.From = myMailFrom
	myMail.To = myMailTo
	myMail.Subject = myMailSubject
	myMail.HTMLBody = strText
	myMail.Send
End With


Set myMail = Nothing
END FUNCTION
%>




BeTheBall -> RE: Change CDOSYS Session Values to DB Values (5/28/2006 23:58:20)

What is not working? Are you getting the email or not? Is an error generating?




evanesnard -> RE: Change CDOSYS Session Values to DB Values (5/29/2006 11:31:45)

Hi Duane. It's working!!!

Knowing that your recommendations on the code changes should be working, I figured I broke some code somewhere in my CDOSYS code during my implementation of your recommended code changes.

So, I stripped my CDOSYS code back down to a basic level with no custom variables and got my page atleast to where it would run and execute the CDOSYS function and send a basic CDOSYS email.

Once I got that working again, I went back and very carefully added in your code recommendations to pull-in the values into the CDOSYS email.

The page now runs fine, the CDOSYS email is sent, and all custom values are written into the CDOSYS email.

Thank you very much for your patience and your excellent guidance on this whole issue.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.171875