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 November 23rd, 2004, 05:35 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Format Retrieved Records

Hello Everyone,

I have created a textbox(areabox) in an ASP page where applicants can copy and paste their resume into. After they hit submit, the data will be stored in a SQL server. Now, if you r familiar of how a resume looks like, they look something like the sample I have pasted below(in red). Pay attention the spacings, tabs, carit returns, etc.

I have two question that I need your help to answer. I have tested this by submitting and storing a resume in SQL. When I go into SQL to look at the data, it looks EXACTLY(with the spacings, tabs, carit returns, etc.) like what I have submitted. First question, is it good programming practice to have it stored like this? I mean, is it bad programming because of the extra spaces, tabs, etc.? Is there another way to do this?

Second question. Remember I mentioned that the format I saw in SQL looks exactly what I have pasted below. However, when I created another page to retrieve this very same resume, the format is all messed up; all texts were not indented as they were when I submitted the it. There were no more spacing between lines. How can I fix this? Please help!!!

Someone told me to use the ASCII (http://www.asciitable.com./) codes to format my texts when retreiving the data. For example, put the data in a variable, and then do something like this: sDocVariable = Replace(sDocVariable, chr(10), "<br>")

But my question is, is this the way and only way to fix the formatting?

Thanks in advance for all your help!!!

Leon


OBJECTIVE: Seeking a Computer System Support or Web Page Design/Maintenance internship

EDUCATION:
    California State University Long Beach
    Bachelor of Science in Business Administration
Major: Management Information System
            Marketing
Emphasis: Business System Analysis

SOFTWARE APPLICATION:
               MS XP Word, Excel, Access, PowerPoint, Publisher, Outlook, FrontPage, Flash 5, Dream weaver 4,
    Adobe Photoshop 6, Adobe Illustrator 9, Adobe Premier, Visual Studio

PROGRAMMING LANGUAGE:
    Oracle/SQL, C++, HTML, Visual Basic

OPERATING SYSTEM:
    Win NT, 95/98/2000/XP

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

Hi Leon,

Yes, to achieve this one has to do all such path works, as the browser could only understand HTML, so it doesn't know what a carriage return is. Also it normally displays one SPACE, when consecutive WHITE SPACES are given in the HTML code. So one has to REPLACE all the CARRIAGE RETURNs with <BR>s and SPACEs with &nbsp;s, similarly one has to interpret the other such characters to the browser understandable tag/code.

But in case or TEXTAREA control, a carriage return is a carriage return and a space is a space, which is different from the way the browser interprets in some cases.

To avoid all these workarounds, you could look for some rich text editors, which could return the HTML code of the content present in the editor and the same when stored and retrieved wouldn't make much difference.

I believe in one of my post, I have recommended a rich text editor that does this job. You may search here on that. Let me post here if I find that myself.

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old November 24th, 2004, 06:56 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Vijay, thanks for the answers. It has been a long time since I posted a question. Hope you are doing good. Anyway, I'll look for that rich text editor you are talking about. I know there are some "off-the-shelf" softwares that are available out there, but I don't really want to purchase them, if I can do a work-around. Thanks for your help!!!

Leon

 
Old November 24th, 2004, 07:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Leon,

Yes, I am doing fine. Hope you are doing good too.

I found that link for you. Take a look at this thread. One of my post contains the link to the free editor. It has been moved to its own website. Though there shows as link to that. It is called htmlarea.

Allowing HTML in form

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old November 29th, 2004, 12:39 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Vijay! You have been a great help!

Leon






Similar Threads
Thread Thread Starter Forum Replies Last Post
Get table records into Txt or CSV format kapi.goel SQL Language 0 April 10th, 2006 01:47 AM
Compare retrieved records life_s Ng General .NET 2 April 11th, 2005 08:32 PM
retrieved data report problem rahmanbd Beginning VB 6 0 March 18th, 2005 08:52 AM
sorting retrieved data don baroo Classic ASP Basics 2 November 23rd, 2004 08:31 AM
have to hyperlink the data retrieved ractim ADO.NET 21 August 27th, 2004 09:34 AM





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