Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 23rd, 2004, 07:47 AM
Registered User
 
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading from database

Hi all,
am starting to get my application working. Thanks for you all for previous help.

The problem now is that I would like to be able to format the output from a database field into paragraphs. What happens is this :

1.user fills in textarea on form with , say summary of their last job
2.data is submitted to d'base via post method
3.reading from database to screen is working ok.

It is the way the output is presented is the problem. Does anybody have any suggestions,
thanks in advance,
larry101

 
Old September 23rd, 2004, 07:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Are you saying that the user enters the summary in paragraphs but that's lost when its re-displayed? If so, just add <pre> tags around the output and that will preserve carriage-returns etc.
 
Old September 23rd, 2004, 08:30 AM
Registered User
 
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

At the moment the summary is written to the database as one long string and is also read from the database as a long string with no formatting done prior to being displayed onscreen.

Does that help in answering your query?
Cheers,
larry101

 
Old September 23rd, 2004, 08:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Then I don't understand how you expect it to be split into paragraphs. If its just one long string, how will you determine where to put the paragraph breaks?
 
Old September 23rd, 2004, 09:39 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi,
     If you want to format the text that is comming from the record set use a para and use one attribute as follows.


<p align=justify> <%=objRs("Text")%></p>

This will format the data. i hope this code will help you.
Thanks
Suresh Babu.T



 
Old September 23rd, 2004, 03:43 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Larry,

If you have used <ENTER> keys twice to identify it as paragraph, then you can do this after retrieving that from database, before displaying it on the page.
Code:
Replace(recordsetObject("ColumnName"),vbCrLF & vbCrLF, "<p>")
OR if you want every <ENTER> keypress to be identified as a paragraph delimiter, then use just one vbCrLF there in the replace function, that should help.

Hope this is what you are looking for.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
reading image from database reza_ahmadi Java Espanol 4 March 8th, 2009 09:35 AM
problem when reading from database al-hijjawi Visual Basic 2005 Basics 0 August 2nd, 2007 01:26 AM
Reading images from Database shankhan Classic ASP Databases 1 March 21st, 2005 01:36 AM
How can I reading InterBase database not24 C# 2 September 21st, 2004 12:51 AM
Reading data from database... Thomas82 Classic ASP Databases 3 February 25th, 2004 03:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.