TEXTAREA FAQ in ASP development

Source: Internet
Author: User
Recently in the news of the background management system, in the access data imported into the SQL SERVER2000, there are a lot of problems, is summarized as follows:
You can convert access data by using the Import feature of SQL Server, but be aware that the original ' self-add ' field needs to be modified to modify the corresponding field identity to ' Yes ' (the original Memo field is automatically converted to ntext).
Because of the addition of news, modification is done by using textarea, first in order to retain the format of the input, in the process of adding the page add
<%
Function sqlstr (data)
Sqlstr = "'" & Replace (data, "'", "" ") &" "
End Function
Function Coder (str)
Dim I
If IsNull (str) then:coder= "": Exit function:end if
For i = 1 to Len (str)
Select case Mid (str,i,1)
Case "<": Coder = coder & "&lt;"
Case ">": Coder = coder & "&gt;"
Case "&": Coder = coder & "&amp;"
Case Chr (9): Coder = coder & "&nbsp;&nbsp;"
Case Vbcrlf:coder = coder & "<br>"
Case CHR: Coder = coder & "&nbsp;"
Case CHR: Coder = coder & "&quot;"
Case Chr (+): Coder = coder & "& #39;"
Case Else:coder = coder & Mid (str,i,1)
End Select
Next
End Function

Content=request ("content") ' body
Content=replace (Content, "&nbsp;", "") is processed here because the spaces added to the modified page are converted to &nbsp;, first filtered
Content=coder (content)

%>
On the Modify page
<%
Rs. Open SQL, Conn, adOpenStatic
Content=rs ("body") ' must be written here, if you write directly at textarea
' <textarea rows= "7" name= "T" cols= "><%=rs" ("Body")%></textarea > "Can not be displayed (I was

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.