• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

Display data into TextArea from Database

How can i display data from a Database into a TextArea in different lines.ie. i want the o/p as
--------------
ccccc
xxxx
tttt
uuuuu
--------------
0
padmamvs
Asked:
padmamvs
  • 4
  • 3
1 Solution
 
xabiCommented:
Make this:

..
..
tmp = ""
while not(rs.EOF)
  tmp = tmp & rs.fields("myfield") & VBCrLf
  rs.movenext
wend
rs.close
..
..
<html>
<textarea><%=tmp%></textarea>
..
..


xabi
0
 
robbertCommented:
<%
Set conn = Server.CreateObject("ADODB.Connection")
Set rec = Server.CreateObjcect("ADODB.Recordset")

conn.Open "ConnectionString"

sq = "SELECT myCol FROM myTable"
rec.Open sq, conn

txt = ""
Do While Not rec.EOF
  txt = txt & rec("myCol") & vbCrLf 'line break
  rec.MoveNext
Loop

rec.Close
conn.Close
Set rec = Nothing
Set conn = Nothing
%>

<html><head></head><body><form>

<textarea><%=txt%></textarea>

</form></body></html>
0
 
xabiCommented:
Robert:

As you can see you say exactly the same as me. Are you only trying to get all points you want. I just give a comment waiting for his questions and you proposed my comment as an answer. Yes, you can say:

I wrote the whole code.
Yes, you are right. I didn't wrote the whole code cuase he didn't ask for it. Now what must I do? Write your code plus an intruduction to ASP?

xabi
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
robbertCommented:
Sorry,
I always open all unread questions in new windows, then go offline, and work on them, then go online and post answers and comments.
If our answers will be accepted, I'll post a question for you, so that you can get "your" points.
0
 
xabiCommented:
Don't worry about points, it doesn't matter. I was just trying to explain how we must work in EE. Anything more.
0
 
xabiCommented:
And sorry for my English, It's my 4th language.
0
 
robbertCommented:
padmanvs,
thank you for accepting the answer. What could I have had improved for to receive an A grade? ;-)

xabi,
you'll find a question for you, named "For Xabi - Session.LCID".
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now