|
-
Jun 5th, 2001, 06:50 AM
#1
Thread Starter
Hyperactive Member
ASPMail - structuring problem
Hello,
I need to create an email which is sent using ASPMail, but I'm having
trouble "structuring" the email properly.
This is basically what I do....
set rs = cn.execute (select * from products)
while not rs.eof
strbody = strbody & rs("prodname") & " " & rs("qty")
rs.movenext
wend
I then send this with "Mailer.BodyText = strbody". My problem is the
spacing - not all prodname's are the same length. I
cannot now have a FIXED number of spaces between prodname & qty, because
then all lines will not be aligned properly! I tried using len(prodname) and
then work out how many spaces I need, but for some reason that does not
want to work!!
Any advice,
T
-
Jun 5th, 2001, 10:46 AM
#2
Black Cat
Are you using Len(rs.Fields("prodname"), because rs.Fields("prodname") might be evaluated to a pointer, in which the length would always be 4. Cast it to a string first, although in ASP everything is a variant anyway.
VB Code:
Dim strProdName
...
strProdName = CStr(rs.Fields("prodname"))
Then Len(strProdName) should work.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jun 5th, 2001, 12:19 PM
#3
Thread Starter
Hyperactive Member
Thanks Josh, I'll give it a try!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|