Microsoft KB Archive/188860

= ACC97: Cannot Enter Line Breaks in Active Server Pages =

Article ID: 188860

Article Last Modified on 1/23/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q188860



Advanced: Requires expert coding, interoperability, and multiuser skills.



SYMPTOMS
In an ASP form, you cannot add line breaks to a field as you can in a form in Microsoft Access. Using CTRL+ENTER will insert a line break; however, after committing the record, the line break will not be present.



CAUSE
The ASP page uses a function, MakeHTMLValue, to convert the user's response to HTML format. Because this function does not have the capability of converting the carriage return and linefeed combination (CR/LF) to the required escape sequence, it is parsed out of the string.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 97.



Steps to Reproduce Problem

 * 1) Open the sample database Northwind.mdb.
 * 2) On the File menu, click Save As HTML. Click Next in the "Publish to the Web" dialog box.
 * 3) On the next screen, select the Customers form on the Forms tab, and then click Next.
 * 4) The next screen prompts you to select a default template. Leave the text box blank an click Next.
 * 5) Select Dynamic ASP, and then click Next.
 * 6) In the Data Source Name box, type the name of a System DSN on your Web server that points to the sample database Northwind.

For more information on how to define a system DSN, search the Help index for "ODBC, setting up data sources," and see the following article in the Microsoft Knowledge Base:

159682 "Data Source Name Not Found" Err Msg Opening Web Page
 * 1) In the Server URL box of that same screen, enter the URL that points to the Web Server location where your ASP files will be stored and click Next.

For example, if you store the ASP files in the \IISSamples folder on the \\PubTest server, type http://pubtest/iissamples/ as your Server URL.
 * 1) Select the folder on your Web server indicated by the Server URL you entered in step 7.

NOTE: This folder must have Execute permission.

For more information on ASP permissions see the following article in the Microsoft Knowledge Base:

162975 ACC97: Permissions Necessary to View HTML, IDC, and ASP Files
 * 1) Click Finish. The "Publish to the Web" Wizard creates 2 files: Customers_1.asp, and Customers_1alx.asp.
 * 2) View the Web page Customers_1.asp in your browser.
 * 3) In the Address field of the first customer record, insert a line break by pressing CTRL+ENTER and enter additional data.
 * 4) Click the Commit button. The data will be written to the Northwind database and the Browser data will be refreshed from the table.

Note that the data in the Address field does not show a line break.

