newline in Access db....

newline in Access db....

am 08.09.2006 17:36:08 von Jimmy

asp page writes to a "memo" field in access.

if the form contains:

line1
line2
line3

when i submit the page, only "line1" is written to the DB.

anyone know how i fix this?

Re: newline in Access db....

am 08.09.2006 17:42:33 von Jimmy

D'oh!

row height!!!

"Jimmy" wrote in message
news:OCtXAy10GHA.4016@TK2MSFTNGP02.phx.gbl...
> asp page writes to a "memo" field in access.
>
> if the form contains:
>
> line1
> line2
> line3
>
> when i submit the page, only "line1" is written to the DB.
>
> anyone know how i fix this?
>
>

Re: newline in Access db....

am 08.09.2006 17:45:24 von McKirahan

"Jimmy" wrote in message
news:OCtXAy10GHA.4016@TK2MSFTNGP02.phx.gbl...
> asp page writes to a "memo" field in access.
>
> if the form contains:
>
> line1
> line2
> line3
>
> when i submit the page, only "line1" is written to the DB.
>
> anyone know how i fix this?

Show us your code after you strip it down to the fewest
number of lines that can replicate the problem.

Re: newline in Access db....

am 08.09.2006 18:02:57 von reb01501

Jimmy wrote:
> asp page writes to a "memo" field in access.
>
> if the form contains:
>
> line1
> line2
> line3
>
> when i submit the page, only "line1" is written to the DB.
>
> anyone know how i fix this?
Hard to say without seeing your code, but this works for me:

<%
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("xxxxxxxxx.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. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: newline in Access db....

am 08.09.2006 22:33:16 von Mike Brind

Exactly. Bear in mind also that when you want to write the memo field
contents back to a web page, you will have to replace the linefeeds -
chr(13) with
.

Response.Write Replace(rs("memofield"),chr(13),"
")

--
Mike Brind


Jimmy wrote:
> D'oh!
>
> row height!!!
>
> "Jimmy" wrote in message
> news:OCtXAy10GHA.4016@TK2MSFTNGP02.phx.gbl...
> > asp page writes to a "memo" field in access.
> >
> > if the form contains:
> >
> > line1
> > line2
> > line3
> >
> > when i submit the page, only "line1" is written to the DB.
> >
> > anyone know how i fix this?
> >
> >

Re: newline in Access db....

am 08.09.2006 22:45:07 von Jimmy

thank you. now if you can tell me why this code doesnt work the way the
"guru" here said it should, id really be thankful!
this is "supposed" to pull a random record from the database and display it
more efficiently than how i was doing it:

<%
Dim oConn, oRS, randNum
Randomize()
randNum = (CInt(1000 * Rnd) + 1) * -1
Set oConn=Server.CreateObject("ADODB.Connection")
Set oRS=Server.CreateObject("ADODB.recordset")
oConn.Provider="Microsoft.Jet.OLEDB.4.0"
oConn.Open Server.MapPath("temp.mdb")

oRS.Open "SELECT TOP 1 EMAIL_ADDRESS, r = " & Rnd(randNum) & " FROM TABLE1",
oConn, adOpenStatic, adLockReadOnly

Response.Write oRS("EMAIL_ADDRESS")

oRS.close
oConn.close
Set oConn = nothing
Set oRS = nothing
%>

but i get an error saying a required parameter is missing.
any ideas?



"Mike Brind" wrote in message
news:1157747596.487248.261440@e3g2000cwe.googlegroups.com...
> Exactly. Bear in mind also that when you want to write the memo field
> contents back to a web page, you will have to replace the linefeeds -
> chr(13) with
.
>
> Response.Write Replace(rs("memofield"),chr(13),"
")
>
> --
> Mike Brind
>
>
> Jimmy wrote:
>> D'oh!
>>
>> row height!!!
>>
>> "Jimmy" wrote in message
>> news:OCtXAy10GHA.4016@TK2MSFTNGP02.phx.gbl...
>> > asp page writes to a "memo" field in access.
>> >
>> > if the form contains:
>> >
>> > line1
>> > line2
>> > line3
>> >
>> > when i submit the page, only "line1" is written to the DB.
>> >
>> > anyone know how i fix this?
>> >
>> >
>

Re: newline in Access db....

am 08.09.2006 22:52:38 von reb01501

Mike Brind wrote:
> Exactly. Bear in mind also that when you want to write the memo field
> contents back to a web page, you will have to replace the linefeeds -
> chr(13) with
.

Not when using a textarea. See my example code


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: newline in Access db....

am 08.09.2006 22:54:36 von reb01501

Jimmy wrote:
> thank you. now if you can tell me why this code doesnt work the way
> the "guru"
If you're referring to me, then you've just earned yourself a plonk.
I've spent all afternoon trying to help you with this ... I was in the
middle of debugging the aircode statement I gave you when I saw this
dig.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: newline in Access db....

am 09.09.2006 00:17:29 von Mike Brind

Well, you've made two mistakes here.

The first is to take a question from one thread and add it to another.
This makes it hard for anyone prepared to provide assistance to work
out what stage the solution has reached. The issue could get resolved
in this thread, yet other people may continue to work on the problem in
the other thread. That's not clever.

The second mistake is to insult someone who has, IMO, been unbelievably
patient with you up to this point. No one here gets paid to offer help
or advice. Most of the regular posters here have full time jobs, and
use their spare time to comtibute.

--
Mike Brind

Jimmy wrote:
> thank you. now if you can tell me why this code doesnt work the way the
> "guru" here said it should, id really be thankful!
> this is "supposed" to pull a random record from the database and display it
> more efficiently than how i was doing it:
>
> <%
> Dim oConn, oRS, randNum
> Randomize()
> randNum = (CInt(1000 * Rnd) + 1) * -1
> Set oConn=Server.CreateObject("ADODB.Connection")
> Set oRS=Server.CreateObject("ADODB.recordset")
> oConn.Provider="Microsoft.Jet.OLEDB.4.0"
> oConn.Open Server.MapPath("temp.mdb")
>
> oRS.Open "SELECT TOP 1 EMAIL_ADDRESS, r = " & Rnd(randNum) & " FROM TABLE1",
> oConn, adOpenStatic, adLockReadOnly
>
> Response.Write oRS("EMAIL_ADDRESS")
>
> oRS.close
> oConn.close
> Set oConn = nothing
> Set oRS = nothing
> %>
>
> but i get an error saying a required parameter is missing.
> any ideas?
>
>
>
> "Mike Brind" wrote in message
> news:1157747596.487248.261440@e3g2000cwe.googlegroups.com...
> > Exactly. Bear in mind also that when you want to write the memo field
> > contents back to a web page, you will have to replace the linefeeds -
> > chr(13) with
.
> >
> > Response.Write Replace(rs("memofield"),chr(13),"
")
> >
> > --
> > Mike Brind
> >
> >
> > Jimmy wrote:
> >> D'oh!
> >>
> >> row height!!!
> >>
> >> "Jimmy" wrote in message
> >> news:OCtXAy10GHA.4016@TK2MSFTNGP02.phx.gbl...
> >> > asp page writes to a "memo" field in access.
> >> >
> >> > if the form contains:
> >> >
> >> > line1
> >> > line2
> >> > line3
> >> >
> >> > when i submit the page, only "line1" is written to the DB.
> >> >
> >> > anyone know how i fix this?
> >> >
> >> >
> >

Re: newline in Access db....

am 15.09.2006 16:49:07 von Daniel Crichton

Jimmy wrote on Fri, 8 Sep 2006 16:45:07 -0400:

> thank you. now if you can tell me why this code doesnt work the way the
> "guru" here said it should, id really be thankful!
> this is "supposed" to pull a random record from the database and display
> it more efficiently than how i was doing it:
>
> <%
> Dim oConn, oRS, randNum
> Randomize()
> randNum = (CInt(1000 * Rnd) + 1) * -1
> Set oConn=Server.CreateObject("ADODB.Connection")
> Set oRS=Server.CreateObject("ADODB.recordset")
> oConn.Provider="Microsoft.Jet.OLEDB.4.0"
> oConn.Open Server.MapPath("temp.mdb")
>
> oRS.Open "SELECT TOP 1 EMAIL_ADDRESS, r = " & Rnd(randNum) & " FROM
> TABLE1", oConn, adOpenStatic, adLockReadOnly
>
> Response.Write oRS("EMAIL_ADDRESS")
>
> oRS.close
> oConn.close
> Set oConn = nothing
> Set oRS = nothing
> %>
>
> but i get an error saying a required parameter is missing.
> any ideas?

Well after taking a dig at Bob I guess most people won't be inclined to
help. I'll give you a hint, rather than fixing your code - you have a lot to
learn about SQL.

Dan