theodore Posted August 19, 2006 Share Posted August 19, 2006 I have done a guestbook.There is a 'textarea' box in the sign page, and the contents of the textarea will be sent to a ASP page.Then the ASP file will insert the contents of the textarea into a MDB file.However, if I input:line1line2line3..in the textarea, and these three lines are saved in the MDB file.When I use a asp file to read the MDB file, the result is:line1 line2 line3How can I insert a serval of lines into a MDB file without changing into one line?Thank you very much. Link to comment Share on other sites More sharing options...
netcracker Posted August 21, 2006 Share Posted August 21, 2006 How can I insert a serval of lines into a MDB file without changing into one line?set the database field type as memo.i think that's what you're looking for. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2006 Share Posted August 22, 2006 If I'm understanding right, you use a web interface to display the text area and when the user presses submit you use ASP to insert the data in an Access database. Then, you use ASP to get the data from the Access database and display it on a web page.If that is the problem, all you need to do is replace the line breaks with HTML line breaks.For java script://output is from the MDBoutput.split("\n").join("<br>");For vb script:output = replace(output, chr(13), "<br>") Link to comment Share on other sites More sharing options...
theodore Posted August 25, 2006 Author Share Posted August 25, 2006 Thank you very much!!!Your methods can solve my problem! Thanks. Link to comment Share on other sites More sharing options...
BluEnt Posted August 25, 2006 Share Posted August 25, 2006 Hi AllI am just new in ASP. Actually i want create one asp form and wants to display form result in same page not the results are retrieves from the database. I just want to display result in top of the form. Like as any Blog site is doing.For that i am using this code but its not working.<body><%Your Name = Request.Form("name")Your Email = Request.Form("email")Your Url = Request.Form("url")Your Comments = Request.Form("commnets")%>Your Name : <%=name%><br />Your Email : <%=email%><br />Your Url : <%=url%><br />Your Comments : <%=commnet%><br /><form action="#" method="get"> <p> <input type="text" name="name" value="" size="30" tabindex="1" /> <label for="author">Name (required)</label> </p> <p> <input type="text" name="email" value="" size="30" tabindex="2" /> <label for="email">E-mail (required, never displayed)</label> </p> <p> <input type="text" name="url" value="" size="30" tabindex="3" /> <label for="url"><abbr title="Uniform Resource Identifier">URL</abbr></label> </p> <p> <textarea name="comment" cols="30" rows="10" tabindex="4"></textarea> <label for="url"><abbr title="Uniform Resource Identifier">Comments</abbr></label> </p> <p> <input name="submit" type="submit" tabindex="5" value="Submit Comment" /> </p> </form> </body>So anyone suggest me what code i have to use in it ?Thanks in advance Link to comment Share on other sites More sharing options...
theodore Posted August 25, 2006 Author Share Posted August 25, 2006 Hi, I think you're quite careless. First, "Your Name" isn't a correct name for varibles.Therefore, <%Your Name = Request.Form("name")Your Email = Request.Form("email")Your Url = Request.Form("url")Your Comments = Request.Form("commnets")%>should change into<%Name = Request.Form("name")Email = Request.Form("email")Url = Request.Form("url")Comments = Request.Form("commnets")%>Secondly, as you're using the function of "Request.Form", the method of the form to be sent should be "post", not "get". On the other hand, if you use "get" method, the Request.Form function should change into "Request.QueryString".Lastly, you spelt the word "comments" three times, but they are not respective."commnet", "commnets" and "comments".The whole script should be:<body><%Name = Request.Form("name")Email = Request.Form("email")Url = Request.Form("url")Comments = Request.Form("comments")%>Your Name : <%=name%><br />Your Email : <%=email%><br />Your Url : <%=url%><br />Your Comments : <%=comments%><br /><form action="#" method="post"> <p><input type="text" name="name" value="" size="30" tabindex="1" /><label for="author">Name (required)</label></p><p><input type="text" name="email" value="" size="30" tabindex="2" /><label for="email">E-mail (required, never displayed)</label></p><p><input type="text" name="url" value="" size="30" tabindex="3" /><label for="url"><abbr title="Uniform Resource Identifier">URL</abbr></label></p><p><textarea name="comments" cols="30" rows="10" tabindex="4"></textarea><label for="url"><abbr title="Uniform Resource Identifier">Comments</abbr></label></p><p><input name="submit" type="submit" tabindex="5" value="Submit Comment" /></p></form> </body>I hope this can solve your problem.Ps: My English is very poor, I hope you can understand what I say. Link to comment Share on other sites More sharing options...
BluEnt Posted August 28, 2006 Share Posted August 28, 2006 Hi TheodoreThanks for your suggestion and coading.Ya some typing mistake was there but now its working. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now