can i preserve newlines in ASP/Access?

can i preserve newlines in ASP/Access?

am 01.10.2006 18:07:25 von SLH

This is a multi-part message in MIME format.

------=_NextPart_000_0029_01C6E552.28518D30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

i have a form on an ASP page that when submitted writes the data from a =
text area to an access DB memo field.
the problem im having is this:

if someone enters:

Dear someone,

im writing this to tel you blah blah

sincerely,

me

if i later pull this from the DB to display on a page, the formatting is =
lost. i think the newlines are being truncated completely because the =
output looks like this:

Dear someone,im writing this... etc.

is there a way to preserve the formatting?

thank you

------=_NextPart_000_0029_01C6E552.28518D30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-1">




i have a form on an ASP page that when =
submitted=20
writes the data from a text area to an access DB memo =
field.

the problem im having is =
this:

 

if someone enters:

 

Dear =
someone,

 

im writing this to tel you blah =

blah

 

size=3D2>sincerely,

 

me

 

if i later pull this from the DB to =
display on a=20
page, the formatting is lost. i think the newlines are being truncated=20
completely because the output looks like this:

 

Dear someone,im writing this... =

etc.

 

is there a way to preserve the=20
formatting?

 

thank you

 


------=_NextPart_000_0029_01C6E552.28518D30--

Re: can i preserve newlines in ASP/Access?

am 01.10.2006 19:02:18 von Mike Brind

SLH wrote:
> i have a form on an ASP page that when submitted writes the data from a text area to an access DB memo field.
> the problem im having is this:
>
> if someone enters:
>
> Dear someone,
>
> im writing this to tel you blah blah
>
> sincerely,
>
> me
>
> if i later pull this from the DB to display on a page, the formatting is lost. i think the newlines are being truncated completely because the output looks like this:
>
> Dear someone,im writing this... etc.
>
> is there a way to preserve the formatting?
>
> thank you
>

SLH/Jimmy/Joe Reynold/etc...

I already answered this for you in another of your posts.

Re: can i preserve newlines in ASP/Access?

am 01.10.2006 19:09:43 von reb01501

SLH wrote:
> i have a form on an ASP page that when submitted writes the data from
> a text area to an access DB memo field.
> the problem im having is this:
>
> if someone enters:
>
> Dear someone,
>
> im writing this to tel you blah blah
>
> sincerely,
>
> me
>
> if i later pull this from the DB to display on a page, the formatting
> is lost. i think the newlines are being truncated completely because
> the output looks like this:
>
> Dear someone,im writing this... etc.
>
> is there a way to preserve the formatting?
>
I cannot reproduce this. Here is my code. What are you doing differently?

<%
dim cn,cmd,sql,ar, s, rs
sql="Insert INTO MYTABLE(ID,memofield) VALUES(?,?)"
if Request.Form.Count>0 then
ar=array(10,Request.Form("txtMemo"))
set cn=CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & server.MapPath("db7.mdb")
set cmd=CreateObject("ADODB.Command")
cmd.CommandText=sql
cmd.CommandType=1 'adCmdText
set cmd.ActiveConnection=cn
on error resume next
cmd.Execute ,ar,128 'adExecuteNoRecords
if err<>0 then
Response.Write "Error upon insert:
" & _
Err.Description
Else
s=""
sql = "select memofield from mytable where id=10"
Err.Clear
set rs=cn.Execute(sql,,1)
if err<>0 then
Response.Write "Error upon retrieval:
" & _
Err.Description
Else
if not rs.eof then s="Data from db" & vbcrlf & rs(0)
end if
end if
rs.close:set rs=nothing
set cmd=nothing
cn.Close:set cn=nothing
end if
%>











--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: can i preserve newlines in ASP/Access?

am 01.10.2006 19:20:15 von Mike Brind

Bob Barrows [MVP] wrote:
> SLH wrote:
> > i have a form on an ASP page that when submitted writes the data from
> > a text area to an access DB memo field.
> > the problem im having is this:
> >
> > if someone enters:
> >
> > Dear someone,
> >
> > im writing this to tel you blah blah
> >
> > sincerely,
> >
> > me
> >
> > if i later pull this from the DB to display on a page, the formatting
> > is lost. i think the newlines are being truncated completely because
> > the output looks like this:
> >
> > Dear someone,im writing this... etc.
> >
> > is there a way to preserve the formatting?
> >
> I cannot reproduce this. Here is my code. What are you doing differently?
>
> <%
> dim cn,cmd,sql,ar, s, rs
> sql="Insert INTO MYTABLE(ID,memofield) VALUES(?,?)"
> if Request.Form.Count>0 then
> ar=array(10,Request.Form("txtMemo"))
> set cn=CreateObject("ADODB.Connection")
> cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=" & server.MapPath("db7.mdb")
> set cmd=CreateObject("ADODB.Command")
> cmd.CommandText=sql
> cmd.CommandType=1 'adCmdText
> set cmd.ActiveConnection=cn
> on error resume next
> cmd.Execute ,ar,128 'adExecuteNoRecords
> if err<>0 then
> Response.Write "Error upon insert:
" & _
> Err.Description
> Else
> s=""
> sql = "select memofield from mytable where id=10"
> Err.Clear
> set rs=cn.Execute(sql,,1)
> if err<>0 then
> Response.Write "Error upon retrieval:
" & _
> Err.Description
> Else
> if not rs.eof then s="Data from db" & vbcrlf & rs(0)
> end if
> end if
> rs.close:set rs=nothing
> set cmd=nothing
> cn.Close:set cn=nothing
> end if
> %>
>
>
>


>
>
>

>
>
>
>
>

He's not writing *to* a textarea - he's taking text submitted to a
database via a textarea in a form and trying to display it as html. As
I said, I gave him the answer to this under one of his other aliases.

--
Mike Brind

Re: can i preserve newlines in ASP/Access?

am 01.10.2006 19:45:05 von Oliver Weichhold

"Mike Brind" wrote in message
news:1159722138.471725.288750@c28g2000cwb.googlegroups.com.. .
>
> SLH wrote:
>> i have a form on an ASP page that when submitted writes the data from a
>> text area to an access DB memo field.
>> the problem im having is this:
>>
>> if someone enters:
>>
>> Dear someone,
>>
>> im writing this to tel you blah blah
>>
>> sincerely,
>>
>> me
>>
>> if i later pull this from the DB to display on a page, the formatting is
>> lost. i think the newlines are being truncated completely because the
>> output looks like this:
>>
>> Dear someone,im writing this... etc.
>>
>> is there a way to preserve the formatting?
>>
>> thank you
>>
>
> SLH/Jimmy/Joe Reynold/etc...
>
> I already answered this for you in another of your posts.
>

sorry Mike. but i dont think that was my post. far as i know this is the
only time i have posted this question.
could you show me where you answered it please?

Re: can i preserve newlines in ASP/Access?

am 01.10.2006 20:41:28 von Mike Brind

SLH wrote:
> "Mike Brind" wrote in message
> news:1159722138.471725.288750@c28g2000cwb.googlegroups.com.. .
> >
> > SLH wrote:
> >> i have a form on an ASP page that when submitted writes the data from a
> >> text area to an access DB memo field.
> >> the problem im having is this:
> >>
> >> if someone enters:
> >>
> >> Dear someone,
> >>
> >> im writing this to tel you blah blah
> >>
> >> sincerely,
> >>
> >> me
> >>
> >> if i later pull this from the DB to display on a page, the formatting is
> >> lost. i think the newlines are being truncated completely because the
> >> output looks like this:
> >>
> >> Dear someone,im writing this... etc.
> >>
> >> is there a way to preserve the formatting?
> >>
> >> thank you
> >>
> >
> > SLH/Jimmy/Joe Reynold/etc...
> >
> > I already answered this for you in another of your posts.
> >
>
> sorry Mike. but i dont think that was my post. far as i know this is the
> only time i have posted this question.
> could you show me where you answered it please?

Different IP this time, but the same ISP, I notice.

As far as pointing out which thread it was in, I'm sorry, but this
"dumbass" doesn't know how to do that.

Re: can i preserve newlines in ASP/Access?

am 01.10.2006 20:51:30 von reb01501

Mike Brind wrote:
>>
>
> He's not writing *to* a textarea - he's taking text submitted to a
> database via a textarea in a form and trying to display it as html.

Ah. So I presume you told him tio surround the text with

 tags ...

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: can i preserve newlines in ASP/Access?

am 01.10.2006 21:07:54 von Mike Brind

Bob Barrows [MVP] wrote:
> Mike Brind wrote:
> >>
> >
> > He's not writing *to* a textarea - he's taking text submitted to a
> > database via a textarea in a form and trying to display it as html.
>
> Ah. So I presume you told him tio surround the text with

 tags ...
>

LOL.