Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 12-09-2005, 02:47 AM   #1
Member (6 bit)
 
prez's Avatar
 
Join Date: Apr 2002
Location: Malaysia
Posts: 60
Send a message via ICQ to prez Send a message via Yahoo to prez
ASP Database Formatting

I cant seem to populate the database so that it shows the formatting such as paragraphs in the text. This is my source code in the attachment.

What i want is that the output in title, introduction,.. etc. to have paragraphs, but instead with the codes above, the paragraphs disappears.

Can someone help me out? Thanks
Attached Files
File Type: txt codes.txt (6.9 KB, 30 views)
prez is offline   Reply With Quote
Old 12-10-2005, 11:22 AM   #2
Member (9 bit)
 
Join Date: Dec 2004
Posts: 289
I'm a bit confused on what you want, but I think I have an idea.

If you are wanting to have it so that when you display the data from the database it is formatted like what it was when you entered it then you need to perform a replace statement.

Example:
Enter into database:
Code:
Blah

Blah


Blah
and have it output exactly like that:
Code:
Blah

Blah


Blah
To do that you need to replace the carriage returns to a paragraph. It keeps parsing my paragraph tag, so I replaced the P with an X. Just replace the X with a p. Also, can anyone tell me how to not make it parse HTML tags? I thought wrapping it in code tags would do that.

Code:
SourceOfText = Replace(SourceOfText, vbCrlf, "<X>")
BEFORE you enter it into the database.

Last edited by PCBrandon; 12-10-2005 at 11:28 AM.
PCBrandon is offline   Reply With Quote
Old 12-10-2005, 08:01 PM   #3
Member (6 bit)
 
prez's Avatar
 
Join Date: Apr 2002
Location: Malaysia
Posts: 60
Send a message via ICQ to prez Send a message via Yahoo to prez
thanks for your reply.

You mean i have to insert the codings before i sent it/store it in the database? but im using the textarea tag and when i check it in the database, it has paragraphs. only when i call it from database using the
<%=strname %> that i get the whole text without paragraphs. If i insert the string into a textarea, it has paragraphs.

so how do i exactly do it? You can check my source code to see what im talking bout. :P

thanks
prez is offline   Reply With Quote
Old 12-10-2005, 09:06 PM   #4
Member (9 bit)
 
Join Date: Dec 2004
Posts: 289
Can you post the code for the file you use to create the reports (where you enter the information into the database)?

Brandon
PCBrandon is offline   Reply With Quote
Old 12-10-2005, 09:58 PM   #5
Member (6 bit)
 
prez's Avatar
 
Join Date: Apr 2002
Location: Malaysia
Posts: 60
Send a message via ICQ to prez Send a message via Yahoo to prez
hmm.. i dont have the codes with me right now. but i used textarea tags for users to enter the text and then store it in the database. In the database the paragraphs are there but not when i request for it in another page.
prez is offline   Reply With Quote
Old 12-10-2005, 10:20 PM   #6
Member (9 bit)
 
Join Date: Dec 2004
Posts: 289
I'll need to see the code for that page to help you anymore. I still think you need to do what I suggested in my first post, but I want to see your code to tell you exactly where to place it and see if it works.

Brandon
PCBrandon is offline   Reply With Quote
Old 12-10-2005, 10:44 PM   #7
Member (6 bit)
 
prez's Avatar
 
Join Date: Apr 2002
Location: Malaysia
Posts: 60
Send a message via ICQ to prez Send a message via Yahoo to prez
thanks. i will post it in a few days time cos i will be away
prez is offline   Reply With Quote
Old 12-13-2005, 06:16 PM   #8
Member (6 bit)
 
prez's Avatar
 
Join Date: Apr 2002
Location: Malaysia
Posts: 60
Send a message via ICQ to prez Send a message via Yahoo to prez
this is the page that you wanted.
Attached Files
File Type: txt code.txt (6.6 KB, 34 views)
prez is offline   Reply With Quote
Old 12-13-2005, 07:34 PM   #9
Member (6 bit)
 
prez's Avatar
 
Join Date: Apr 2002
Location: Malaysia
Posts: 60
Send a message via ICQ to prez Send a message via Yahoo to prez
i finally found out how to solve it. All i need to do is insert this in the main page

sqlReportID = Replace(sqlReportID ,vbcrlf,"
")

and walla... thanks for your help.

but now i cant insert any word that has an aprostophe. if i do, then i get an error

Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression

how do i solve this? is it because of the way i code it or is there solutions to this problem? thanks
prez is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:01 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2