
April 25th, 2001, 05:48 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
Line feeds, carraige returns etc.....memo field....
<i><b>Originally posted by : Mal (mal@go-planit.com)</b></i><br /> I'm really new to ASP so some help would be really appreciated.<br />I have a DB that returns data to a table in a ASP page, this works no problems EXCEPT it doesn't return the line feeds, carraige returns... here's the code.<br /><br /><% Set MyConn=Server.CreateObject("ADODB.Connection")<br />MyConn.Open "PROVIDER=MSDASQL;" & _<br />"DRIVER={Microsoft Access Driver (*.mdb)}; " & _<br />"DBQ=" & server.mappath("my.mdb")<br />MySQL="Select News.Text1, News.Text2 from News"<br />Set MyRs=MyConn.Execute(MySQL)<br />%><br /><div align="center"><br /><center><br /><table border=0 width="100%" cellspacing="0" cellpadding="0"><br /><tr><% 'Put Headings On The Table of Field Names<br />howmanyfields=MyRs.fields.count -1<br />for i=0 to howmanyfields %><br /><% next %><br /></tr><br /><% ' Get all the records<br />do while not MyRs.eof %><br /><tr><br /><% for i = 0 to howmanyfields<br /> ThisRecord = MyRs(I)<br /> If IsNull(ThisRecord) Then<br /> ThisRecord = " "<br />end if %><br /> <td valign=top><br /> <p style="margin-left: 25; margin-right: 25; margin-top: 20"><font face="Arial, Helvetica, sans-serif" size="-1"><%=Thisrecord%></font></td><% next %><br /></tr><br /><%MyRs.movenext<br />loop%><br /></table><br /></center><br /></div><br /><%MyRs.close<br />Set MyRs= Nothing<br />MyConn.Close<br />set MyConn=nothing%><br /><br />I've seen this thread on another forum that advises this:-<br /><br />strNote = RS("note")<br />strNote = Server.HTMLEncode(strNote)<br />strNote = Replace(strNote, vbCrLf & vbCrlf, "<p>")<br />strNote = Replace(strNote, vbCrLf, "<br>")<br /><br />So it looks like the solution to my problems, but I don't know how to intigrate it/what to change/where to put it in my above code. Any help would be much appreciated. <br />
|