Code problems

Results 1 to 3 of 3

Thread: Code problems

  1. #1
    Jason Guest

    Default Code problems

    Please look at my code and try to help me. <BR>The data from the form makes it to the database 100% of the time. But i only recive the email about 50 % of the time. <BR>I took all the database code out and left the email code in and the email works 100% of the time. I think the problem is when i try to pull the ID from the database. Does anybody know a better way of doing this? <BR><BR><BR>&#060;% <BR>Function ParseBody(strText) <BR><BR>strText = Replace(strText, Chr(13), " <BR>") <BR><BR>ParseBody = strText <BR><BR>End Function <BR><BR> &#039;SET UP DATABASE CONNECTION <BR> Dim objConn <BR>Set objConn = Server.CreateObject("ADODB.Connection") <BR> objConn.Open "dsn=TO" <BR><BR> <BR> &#039;DECLARE RECORDSET FOR ADD <BR> Dim objRS <BR> Set objRS = Server.CreateObject("ADODB.Recordset") <BR> objRS.Open "TO", objConn, adOpenKeySet, adLockOptimistic, adCmdTable <BR><BR>objRS.AddNew <BR>objRS("STR_FROM_ORG") = Request.Form("FromORG") <BR>objRS("STR_To_ORG") = Request.Form("ToORG") <BR>objRS("STR_From_Working_Title") = Request.Form("FromWorkingTitle") <BR>objRS("STR_To_Working_Title") = Request.Form("ToWorkingTitle") <BR>objRS("STR_From_Classification") = Request.Form("FromClassification") <BR>objRS("STR_To_Classification") = Request.Form("ToClassification") <BR>objRS("STR_From_Employee_Name") = Request.Form("FromEmployeeName") <BR>objRS("STR_To_Employee_Name") = Request.Form("ToEmployeeName") <BR>objRS("STR_From_Class") = Request.Form("FromClass") <BR>objRS("STR_To_Class") = Request.Form("ToClass") <BR>objRS("STR_From_Fund") = Request.Form("FromFund") <BR>objRS("STR_To_Fund") = Request.Form("ToFund") <BR>objRS("STR_From_Code") = Request.Form("FromCode") <BR>objRS("STR_To_Code") = Request.Form("ToCode") <BR>objRS("STR_From_Full_or_Part") = Request.Form("FromFullorPart") <BR>objRS("STR_To_Full_or_Part") = Request.Form("ToFullorPart") <BR>objRS("STR_From_Position") = Request.Form("FromPosition") <BR>objRS("STR_To_Position") = Request.Form("ToPosition") <BR>objRS("STR_From_Add_Position") = Request.Form("FromAddPosition") <BR>objRS("STR_To_Add_Position") = Request.Form("ToAddPosition") <BR>objRS("STR_SUBMITTED_BY") = Request.Form("SubmittedBy") <BR>objRS("DTM_Date_of_TO_Used") = Request.Form("DateofToUsed") <BR>objRS("STR_Approved_By") = Request.Form("ApprovedBy") <BR>objRS("STR_Assistant_Director") = Request.Form("AssistantDirector") <BR>objRS("DTM_Date_Submitted_TO_HR") = Request.Form("DateSubmittedtoHR") <BR>objRS("STR_Email_Address") = Request.Form("EmailAddress") <BR>&#039;objRS("DTM_Time_Stamp") = Request.Form("TimeStamp") <BR>objRS.Update <BR><BR>&#039;Pull ID from database <BR>Dim strID <BR>strID=objRS("ID") <BR><BR>&#039;Close the connection <BR>objRS.Close <BR>Set objRS = Nothing <BR>objConn.Close <BR>Set objConn = Nothing <BR>&#039;**************************************** ************************************ <BR>&#039;Email <BR>&#039;**************************************** ************************************ <BR>Dim myCDONTSMail <BR>Dim strTo <BR>Dim strFrom <BR>Dim strSubject <BR>Dim strBody <BR>Dim strsubby <BR><BR>strsubby= Request.Form("SubmittedBy") <BR>strTo= Request.Form("EmailAddress") <BR>strFrom= Request.Form("submittedBy") <BR>strSubject = "Table of Organization Change Form" <BR>strBody = strsubby &", has submitted a Table of Organization Form:" & vbcrlf & "ID #: = " & strID & vbcrlf & "Please go to HTTP://jfsstage/JFSSTAGE/TO/searchid.asp and enter the ID Number above for this Request." <BR><BR><BR>&#039;Create a new mail message object <BR>Set myCDONTSMail = CreateObject("CDONTS.NewMail") <BR><BR>&#039;Sent the new mail message object by passing the parameters <BR>&#039;defined above <BR>myCDONTSMail.Send strFrom,strTo,strSubject,strBody <BR>&#039;Set the new mail message object to Nothing to free resources <BR>Set myCDONTSMail = Nothing <BR>%&#062;

  2. #2
    repost Guest

    Default RE: Code problems

    Didn&#039;t I see this problem before?<BR>Check out the replies on your previous post please...

  3. #3
    Jason Guest

    Default RE: Code problems

    It did not work. I am just looking for some help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts