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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to separate the string?

Status
Not open for further replies.

ckevin

MIS
Jul 22, 2003
8
US
Hi all, I have a problem on formatting my result.

String variable named "descripation" is inserted into MS-SQL by using textarea field of form, in multiple lines, and datatype is "varchar" .

I get this string from MS-SQL server by this simple SQL query:



DBConn.Open "select description from abc where id = '123'"
description = DBConn("description")




The problem comes out when I list this out. It is prefectly ok when I list it in a textarea like:


<textarea name=&quot;description&quot; cols=&quot;50&quot; rows=&quot;5&quot;><%=description%></textarea>


But when I list it out in the normal html, all multiple lines comes to only one line.

What is the best way to solve this problem?

Thank you very much

Kevin

 
<%=Replace(description,vbcrlf,&quot;<br>&quot;%>

Each return line in a textfield is represented by vbcrlf so when outputing it as html you just replace vbcrlf with <br> and your good to go!

- Jason

www.vzio.com
ASP WEB DEVELOPMENT



 
Oops forgot a &quot;)&quot;

<%=Replace(description,vbcrlf,&quot;<br>&quot;)%>

www.vzio.com
ASP WEB DEVELOPMENT



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top