|
 |
access_asp thread: do while in email form
Message #1 by "Lori Bannon" <lori@s...> on Fri, 21 Mar 2003 23:01:45
|
|
Hi again my favorite place. I am setting up an email P.O. form that gets
generated as soon as the customer sends his order online. So far so good,
I can get the email sent and I even can pass the variables to the email.
But when it came time to seperate the products if the customer ordered
more than one I get an error. Apparentely it doesn't like the do while.
Here's my code:
HTML = HTML & "<HTML>"
HTML = HTML & "<HEAD>"
HTML = HTML & "<TITLE>P.O.</TITLE>"
HTML = HTML & "</HEAD>"
HTML = HTML & "<BODY bgcolor=""#ededed"">"
HTML = HTML & "<TABLE cellpadding=""4"" border=""1""
bordercolor=""#003366"">"
HTML = HTML & "<tr><td colspan=""2"" bgcolor=""#999999=""><font
face=""Arial""><strong>name of
business</strong><br />¤ po<br /> ¤&nbs
p; city, state,
zip<br /> ¤  phone<br /> ¤&nbs
p; fax<br /> ¤ email<br />"
HTML = HTML & pOrderDate & "</font></td>"
HTML = HTML & "<tr><td class=""textMain""><font
face=""Arial""><strong>Bill To:</strong><br />"
HTML = HTML & pDealerName & "<br />"
HTML = HTML & pBillAddress & "<br />"
HTML = HTML & pBillCity & " " & pBillState & " "
& pBillZip & "<br />"
HTML = HTML & pPhone & "<br />"
HTML = HTML & pFax & "</font></td><td class=""textMain""><font
face=""Arial""><strong>Ship To:</strong><br />"
HTML = HTML & pShipAddress & "<br />"
HTML = HTML & pShipCity & " " & pShipState & " "
& pShipZip & "<br />"
HTML = HTML & pPhone & "<br />"
HTML = HTML & pFax & "</font></td></tr><tr><td colspan=""2""
class=""textMain=""><font face=""Arial""><strong>Order:</strong><br />"
problem -----> HTML = HTML & do while not oRs.eof
HTML = HTML & pQuantity & " "
HTML = HTML & pManufacturer & " "
HTML = HTML & pModel & " "
HTML = HTML & pTotal & " "
HTML = HTML & oRs.moveNext loop & "</td></tr><tr><td colspan=""2""
class=""textMain=""><font face=""Arial""><strong>Terms:</strong><br />"
HTML = HTML & pTerms & "</font></td></TR></TABLE>"
HTML = HTML & "</BODY>"
HTML = HTML & "</HTML>"
thanks in advance
Lori
Message #2 by "Zee Computer Consulting" <zee@t...> on Fri, 21 Mar 2003 17:35:36 -0800
|
|
Your method of building one long string with all the commands makes is
overly complicated and doesn't work right.
Also, use indenting and blank lines to group and organize program statements
and use comments to summarize the intention of the code. These are
professional techniques to make troubleshooting faster. You program code
should look tidy and organized.
Generally speaking, script sections must be enclosed with:
<%
%>
and I recommend changing to using the "Response.Write()" method in your
program loop in this revised code segment (Does this make sense to you?):
' Begin VbScript section
<%
' Begin the table
Response.Write( "<table>" )
' Loop through the line item records
DO WHILE not oRs.eof
' Write out this line of data as a table row
Response.Write( "<tr>" )
Response.Write( "<td>" & pQuantity & "</td>" )
Response.Write( "<td>" & pManufacturer & "</td>" )
Response.Write( "<td>" & pModel & "</td>" )
Response.Write( "<td>" & pTotal & "</td>" )
Response.Write( "</tr>" )
' Move to the next record
oRs.MoveNext
LOOP
' End of loop through line items
' End this table
Response.Write( "</table>" )
' End script section
%>
-- Zee
----- Original Message -----
From: "Lori Bannon" <lori@s...>
To: "Access ASP" <access_asp@p...>
Sent: Friday, March 21, 2003 11:01 PM
Subject: [access_asp] do while in email form
> Hi again my favorite place. I am setting up an email P.O. form that gets
> generated as soon as the customer sends his order online. So far so good,
> I can get the email sent and I even can pass the variables to the email.
> But when it came time to seperate the products if the customer ordered
> more than one I get an error. Apparentely it doesn't like the do while.
> Here's my code:
>
> HTML = HTML & "<HTML>"
> HTML = HTML & "<HEAD>"
> HTML = HTML & "<TITLE>P.O.</TITLE>"
> HTML = HTML & "</HEAD>"
> HTML = HTML & "<BODY bgcolor=""#ededed"">"
> HTML = HTML & "<TABLE cellpadding=""4"" border=""1""
> bordercolor=""#003366"">"
> HTML = HTML & "<tr><td colspan=""2"" bgcolor=""#999999=""><font
> face=""Arial""><strong>name of
> business</strong><br />¤ po<br
/> ¤&nbs
> p; city, state,
> zip<br /> ¤  phone<br
/> ¤&nbs
> p; fax<br /> ¤ email<br />"
> HTML = HTML & pOrderDate & "</font></td>"
> HTML = HTML & "<tr><td class=""textMain""><font
> face=""Arial""><strong>Bill To:</strong><br />"
> HTML = HTML & pDealerName & "<br />"
> HTML = HTML & pBillAddress & "<br />"
> HTML = HTML & pBillCity & " " & pBillState & " "
> & pBillZip & "<br />"
> HTML = HTML & pPhone & "<br />"
> HTML = HTML & pFax & "</font></td><td class=""textMain""><font
> face=""Arial""><strong>Ship To:</strong><br />"
> HTML = HTML & pShipAddress & "<br />"
> HTML = HTML & pShipCity & " " & pShipState & " "
> & pShipZip & "<br />"
> HTML = HTML & pPhone & "<br />"
> HTML = HTML & pFax & "</font></td></tr><tr><td colspan=""2""
> class=""textMain=""><font face=""Arial""><strong>Order:</strong><br />"
> problem -----> HTML = HTML & do while not oRs.eof
> HTML = HTML & pQuantity & " "
> HTML = HTML & pManufacturer & " "
> HTML = HTML & pModel & " "
> HTML = HTML & pTotal & " "
> HTML = HTML & oRs.moveNext loop & "</td></tr><tr><td colspan=""2""
> class=""textMain=""><font face=""Arial""><strong>Terms:</strong><br />"
> HTML = HTML & pTerms & "</font></td></TR></TABLE>"
> HTML = HTML & "</BODY>"
> HTML = HTML & "</HTML>"
>
>
>
> thanks in advance
> Lori
>
Message #3 by "Lori Bannon" <lori@s...> on Mon, 24 Mar 2003 15:40:36
|
|
Zee, Perhaps you didn't understand. the HTML string is for the
objMail.Body = HTML mail object. Like I said, this is an email form. I
have to have one long string variable for the mail object.
> Your method of building one long string with all the commands makes is
overly complicated and doesn't work right.
Also, use indenting and blank lines to group and organize program
statements
and use comments to summarize the intention of the code. These are
professional techniques to make troubleshooting faster. You program code
should look tidy and organized.
Generally speaking, script sections must be enclosed with:
<%
%>
and I recommend changing to using the "Response.Write()" method in your
program loop in this revised code segment (Does this make sense to you?):
' Begin VbScript section
<%
' Begin the table
Response.Write( "<table>" )
' Loop through the line item records
DO WHILE not oRs.eof
' Write out this line of data as a table row
Response.Write( "<tr>" )
Response.Write( "<td>" & pQuantity & "</td>" )
Response.Write( "<td>" & pManufacturer & "</td>" )
Response.Write( "<td>" & pModel & "</td>" )
Response.Write( "<td>" & pTotal & "</td>" )
Response.Write( "</tr>" )
' Move to the next record
oRs.MoveNext
LOOP
' End of loop through line items
' End this table
Response.Write( "</table>" )
' End script section
%>
-- Zee
----- Original Message -----
From: "Lori Bannon" <lori@s...>
To: "Access ASP" <access_asp@p...>
Sent: Friday, March 21, 2003 11:01 PM
Subject: [access_asp] do while in email form
> Hi again my favorite place. I am setting up an email P.O. form that gets
> generated as soon as the customer sends his order online. So far so good,
> I can get the email sent and I even can pass the variables to the email.
> But when it came time to seperate the products if the customer ordered
> more than one I get an error. Apparentely it doesn't like the do while.
> Here's my code:
>
> HTML = HTML & "<HTML>"
> HTML = HTML & "<HEAD>"
> HTML = HTML & "<TITLE>P.O.</TITLE>"
> HTML = HTML & "</HEAD>"
> HTML = HTML & "<BODY bgcolor=""#ededed"">"
> HTML = HTML & "<TABLE cellpadding=""4"" border=""1""
> bordercolor=""#003366"">"
> HTML = HTML & "<tr><td colspan=""2"" bgcolor=""#999999=""><font
> face=""Arial""><strong>name of
> business</strong><br />¤ po<br
/> ¤&nbs
> p; city, state,
> zip<br /> ¤  phone<br
/> ¤&nbs
> p; fax<br /> ¤ email<br />"
> HTML = HTML & pOrderDate & "</font></td>"
> HTML = HTML & "<tr><td class=""textMain""><font
> face=""Arial""><strong>Bill To:</strong><br />"
> HTML = HTML & pDealerName & "<br />"
> HTML = HTML & pBillAddress & "<br />"
> HTML = HTML & pBillCity & " " & pBillState & " "
> & pBillZip & "<br />"
> HTML = HTML & pPhone & "<br />"
> HTML = HTML & pFax & "</font></td><td class=""textMain""><font
> face=""Arial""><strong>Ship To:</strong><br />"
> HTML = HTML & pShipAddress & "<br />"
> HTML = HTML & pShipCity & " " & pShipState & " "
> & pShipZip & "<br />"
> HTML = HTML & pPhone & "<br />"
> HTML = HTML & pFax & "</font></td></tr><tr><td colspan=""2""
> class=""textMain=""><font face=""Arial""><strong>Order:</strong><br />"
> problem -----> HTML = HTML & do while not oRs.eof
> HTML = HTML & pQuantity & " "
> HTML = HTML & pManufacturer & " "
> HTML = HTML & pModel & " "
> HTML = HTML & pTotal & " "
> HTML = HTML & oRs.moveNext loop & "</td></tr><tr><td colspan=""2""
> class=""textMain=""><font face=""Arial""><strong>Terms:</strong><br />"
> HTML = HTML & pTerms & "</font></td></TR></TABLE>"
> HTML = HTML & "</BODY>"
> HTML = HTML & "</HTML>"
>
>
>
> thanks in advance
> Lori
>
Message #4 by "Zee Computer Consulting" <zee@t...> on Mon, 24 Mar 2003 20:02:06 -0800
|
|
Yes, I am sorry, I missed that.
-- Zee
----- Original Message -----
From: "Lori Bannon" <lori@s...>
To: "Access ASP" <access_asp@p...>
Sent: Monday, March 24, 2003 3:40 PM
Subject: [access_asp] Re: do while in email form
> Zee, Perhaps you didn't understand. the HTML string is for the
> objMail.Body = HTML mail object. Like I said, this is an email form. I
> have to have one long string variable for the mail object.
>
>
>
> > Your method of building one long string with all the commands makes is
> overly complicated and doesn't work right.
>
> Also, use indenting and blank lines to group and organize program
> statements
> and use comments to summarize the intention of the code. These are
> professional techniques to make troubleshooting faster. You program code
> should look tidy and organized.
>
> Generally speaking, script sections must be enclosed with:
>
> <%
>
> %>
>
> and I recommend changing to using the "Response.Write()" method in your
> program loop in this revised code segment (Does this make sense to you?):
>
>
> ' Begin VbScript section
> <%
>
> ' Begin the table
> Response.Write( "<table>" )
>
> ' Loop through the line item records
> DO WHILE not oRs.eof
>
> ' Write out this line of data as a table row
> Response.Write( "<tr>" )
> Response.Write( "<td>" & pQuantity & "</td>" )
> Response.Write( "<td>" & pManufacturer & "</td>" )
> Response.Write( "<td>" & pModel & "</td>" )
> Response.Write( "<td>" & pTotal & "</td>" )
> Response.Write( "</tr>" )
>
> ' Move to the next record
> oRs.MoveNext
>
> LOOP
> ' End of loop through line items
>
> ' End this table
> Response.Write( "</table>" )
>
> ' End script section
> %>
>
>
>
> -- Zee
>
>
>
>
> ----- Original Message -----
> From: "Lori Bannon" <lori@s...>
> To: "Access ASP" <access_asp@p...>
> Sent: Friday, March 21, 2003 11:01 PM
> Subject: [access_asp] do while in email form
>
>
> > Hi again my favorite place. I am setting up an email P.O. form that gets
> > generated as soon as the customer sends his order online. So far so
good,
> > I can get the email sent and I even can pass the variables to the email.
> > But when it came time to seperate the products if the customer ordered
> > more than one I get an error. Apparentely it doesn't like the do while.
> > Here's my code:
> >
> > HTML = HTML & "<HTML>"
> > HTML = HTML & "<HEAD>"
> > HTML = HTML & "<TITLE>P.O.</TITLE>"
> > HTML = HTML & "</HEAD>"
> > HTML = HTML & "<BODY bgcolor=""#ededed"">"
> > HTML = HTML & "<TABLE cellpadding=""4"" border=""1""
> > bordercolor=""#003366"">"
> > HTML = HTML & "<tr><td colspan=""2"" bgcolor=""#999999=""><font
> > face=""Arial""><strong>name of
> > business</strong><br />¤ po<br
> /> ¤&nbs
> > p; city, state,
> > zip<br /> ¤  phone<br
> /> ¤&nbs
> > p; fax<br /> ¤ email<br />"
> > HTML = HTML & pOrderDate & "</font></td>"
> > HTML = HTML & "<tr><td class=""textMain""><font
> > face=""Arial""><strong>Bill To:</strong><br />"
> > HTML = HTML & pDealerName & "<br />"
> > HTML = HTML & pBillAddress & "<br />"
> > HTML = HTML & pBillCity & " " & pBillState &
" "
> > & pBillZip & "<br />"
> > HTML = HTML & pPhone & "<br />"
> > HTML = HTML & pFax & "</font></td><td class=""textMain""><font
> > face=""Arial""><strong>Ship To:</strong><br />"
> > HTML = HTML & pShipAddress & "<br />"
> > HTML = HTML & pShipCity & " " & pShipState &
" "
> > & pShipZip & "<br />"
> > HTML = HTML & pPhone & "<br />"
> > HTML = HTML & pFax & "</font></td></tr><tr><td colspan=""2""
> > class=""textMain=""><font face=""Arial""><strong>Order:</strong><br />"
> > problem -----> HTML = HTML & do while not oRs.eof
> > HTML = HTML & pQuantity & " "
> > HTML = HTML & pManufacturer & " "
> > HTML = HTML & pModel & " "
> > HTML = HTML & pTotal & " "
> > HTML = HTML & oRs.moveNext loop & "</td></tr><tr><td colspan=""2""
> > class=""textMain=""><font face=""Arial""><strong>Terms:</strong><br />"
> > HTML = HTML & pTerms & "</font></td></TR></TABLE>"
> > HTML = HTML & "</BODY>"
> > HTML = HTML & "</HTML>"
> >
> >
> >
> > thanks in advance
> > Lori
> >
>
>
>
|
|
 |