Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

carriage returns

Status
Not open for further replies.

blueindian1

Programmer
Apr 24, 2001
150
US
Hello,

I have a text area that i need to place an address in. The address comes from the database as 8 columns. I need to put each of the columns on a seperate line. Therefor, I need to have a carriage return appended to the end of each line.

Javascript is not an option for this problem. Anyone know how to do it strictly with asp?

thanks,

rich
 
When you write the address from the DB use
response.write rs(&quot;Line1&quot;) & &quot;<br>&quot; & rs(&quot;Line2&quot;) & &quot;<br>&quot; ...

This was your question?

Regards,
Durug
 
yup...
talk about my making a problem more difficult than it was!

thanks..
 
well i spoke too soon.

had the same problem as when i was trying to use &quot;/n&quot; for a carriage return. the &quot;<br>&quot; gets interpreted as a literal, so the display i get is:

PO BOX 809<br>46 STAFFORD ST<br>LAWRENCE, MA 018420000<br>US<br>

from this code

Code:
 'get the display addresses
     if strBillTo <> &quot;&quot; then
	   sql =       &quot; select address_id, address1, address2, address3, address4, &quot;
	   sql = sql + &quot; city, state, postal_code, country, province &quot;
	   sql = sql + &quot; from cisx_addresses@d2gso1 &quot;
	   sql = sql + &quot; where address_id = &quot; & strBillTo


		set rs = dataconn.execute(Sql,,adCmdText)
		rs.cachesize = 1000
		if not rs.EOF then
		
	for counter = 1 to 4
	  if ((rs(counter)<> &quot;&quot;) AND ( not isNull(rs(counter)))) then
	  
	    strBillToName = strBillToName & rs(counter) & &quot;<br>&quot;
	  end if
	
	next
	
	'city
	  if ((rs(5)<> &quot;&quot;) AND ( not isNull(rs(5)))) then
	    strBillToName = strBillToName & rs(5) & &quot;, &quot;
	  end if
	
	'state
	  if ((rs(6)<> &quot;&quot;) AND ( not isNull(rs(6)))) then
	    strBillToName = strBillToName & rs(6) & &quot;  &quot;
	  end if

	'zip
	  if ((rs(7)<> &quot;&quot;) AND ( not isNull(rs(7)))) then
	    strBillToName = strBillToName & rs(7) & &quot;<br>&quot;
	  end if
	  
	'country
	  if ((rs(8)<> &quot;&quot;) AND ( not isNull(rs(8)))) then
	    strBillToName = strBillToName & rs(8) & &quot;<br>&quot;
	  end if
	
	'province
	  if ((rs(9)<> &quot;&quot;) AND ( not isNull(rs(9)))) then
	    strBillToName = strBillToName & rs(9)
	  end if
	
	
		

			rs.Close
			set rs = nothing
		end if
     end if
 
I haven't tested this but ,have you tried vbCrLF?

Richie




 
Yes, use vbCrLF if you display the address like this.
rs(&quot;Line1&quot;) & vbCrLF & rs(&quot;Line2&quot;) & vbCrLF & ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top