Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To work around this behavior, replace the CRLF character sequences used by Access with the <BR> tag using Active Server Pages (ASP) code.
Code Sample
Note You may receive an error message if you copy and paste the examples directly from this article to FrontPage. The angle brackets ("<" and ">") may appear as escaped HTML code ("<" and ">"). To work around this behavior, paste the script in a blank Notepad document, and then copy it from Notepad before pasting it into FrontPage.
- To create a form page, follow these steps:
- Start FrontPage and open a Web site on a Web server that is running Internet Information Services 4.0 or later.
- On the File menu, click New, and then click Page.
- Select Normal Page from the list of available templates, and then click OK.
- On the File menu, click Save As. In the File name box, type FormTest.asp and then click Save.
- On the Insert menu, point to Form, and then click Scrolling Text Box.
- Right-click the text box. On the shortcut menu, click Form Field Properties.
- Make the following changes in the Scrolling Text Box Properties dialog box:
- Name = Sample
- Width in characters = 40
- Number of lines = 10
- Click OK to close the Scrolling Text Box Properties dialog box.
- Right-click the form. On the shortcut menu, click Form Properties.
- In the Form Properties dialog box, select Send to database, and then click Options.
- In the Options for Saving Results to Database dialog box, click Create Database. Click OK in each dialog box to return to the page FormTest.asp.
- On the toolbar, click Save.
- Click Preview in Browser on the FrontPage toolbar.
- Click in the text area, and then type the following lines. Press ENTER twice at the end of each of the first two sentences:
This is a test.
This block of text has three lines.
They are separated by blank lines.
- Click the Submit button to submit the information to the database.
- Close your Web browser.
- To create a display page, follow these steps:
- On the FrontPage File menu, point to New, click Page, select Normal Page, and then click OK to create another new blank page. Save the page as DisplayTest.asp.
- On the Insert menu, point to Database, and then click Results.
- In page 1 of the Database Results Wizard, select FormTest and then click Next.
- In page 2, select Results and then click Next.
- In page 3, click Edit List.
- In the Displayed fields list, remove all fields except Sample, click OK, and then click Next.
- In page 4, select List - one field per item from the formatting options and Paragraphs from the list options, and then click Next.
- In page 5, select Display all records together, and then click Finish.
- Save the page.
- Click Preview in Browser on the FrontPage toolbar.
- When the page is displayed, the text appears without line breaks.
- Close your Web browser.
- To implement the workaround, follow these steps:
- Open DisplayTest.asp, click <<sample>> and then press DELETE.
- Switch to HTML view and locate the HTML code that is similar to the following:
<p><b>Sample:</b> </p>
- Change the HTML code to the following:
<p><b>Sample:</b> <%=Replace(FP_FieldVal(fp_rs,"Sample"),vbCrLf,"<br>")%></p>
Note The ASP code FP_FieldVal(fp_rs,"Sample") is FrontPage's code for returning a database column, and <%=Replace(FP_FieldVal(fp_rs,"Sample"),vbCrLf,"<br>")%> is the ASP code to format a database column with all the carriage returns replaced by HTML "line breaks".
- On the toolbar, click Save, and then click Preview in Browser.
- When the page is displayed, the text appears with line breaks.