Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2004, 05:29 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting "TextArea" field's data problem

Hi All,

I have an ASP form with a "textarea" field, where user can copy and paste their resume into. When the user click on "SUBMIT" the database will be updated. I am using a SQL database with a column named "resume." I set the datatype to varchar and size 3000.

As you know, most people's resume looks something like this:

Leon Phung
100 Woods Street #12
San Diego, CA 96058
(888)828-4067
E-mail: [email protected]

EDUCATION:
Bachelor of Science Business Administration
Major: Management Information System
California State University, Long Beach
.
.
.
.


Here is the problem. Everything works on my ASP page, but when I view the record in the database, I ONLY see "Leon Phung." The rest of the information were NOT inserted. Any idea of what might have happened?

Thank you.

Leon


 
Old July 28th, 2004, 06:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can you post your code related to textarea and storing data into db?

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 28th, 2004, 07:05 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I named my textarea field as "sResume." And here is how I insert it into the database:


strSQL = "Insert into internship_form (submitdate, resume"
strValues="Values('" & (Request.querystring("submitdate")) & "'" & ",'" & _
CStr(replace(request.querystring("sResume"),"'", "''")) & "'"



 
Old July 28th, 2004, 07:08 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Vijay,

Here is how my field looks like:

<textarea name="sresume" cols="60" rows="5" id="sresume"></textarea>

Please let me know if you need more code. THank you.

Leon

 
Old July 28th, 2004, 07:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Your sql statement in the previous post looks incomplete. Not sure if that really works.

Also it looks like you are using GET method in form, why not use POST method there and use REQUEST.FORM("sResume")

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 28th, 2004, 07:22 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vijay,

My sql codes looks incomplete b/c I did not put the whole codes in...my sql statment DOES work when I ran my ASP page.

Is there a different if I were to use POST instead of GET? I thought the only different between the two is how they are being processed on the web server? I'll try using POST instead, but I really don't want to do that, b/c I have at least 30 fields on my form to input. Thanks.

 
Old July 28th, 2004, 07:29 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just tried with POST, but still having the same problem. Could it be the "white-spaces?" Meaning, since I have a "return" right after "Leon Phung," it takes in only the first line?

 
Old July 28th, 2004, 07:30 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

It is better to do a POST than GET, as in GET, all the data are passed along with the page URL as querystring, and it is not safe, also if the data passed is huge, due to length limitations, you may miss some data, So It is advised to use POST in your case. I hope that should solve your problem, as you say I have 30 Fields in the form. I suspect the GET method is eating up the remaining of your resume. This way your resume will not be looked up by anyone, if GET eats up all your skills.;)

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 28th, 2004, 07:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Then try and print(response.write) your sResume textarea value just on top of the page after you submit the form, and see if that contains the whole data.

Code:
Response.write Request.Form("sResume")
Response.end
Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 29th, 2004, 10:11 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Vijay,

Thanks for the tips on GET and POST! I know about the visibility, but never knew about the size limitation.

Anyway, I did the response.write as you have mentioned, and I see the whole resume that I submmitted. Is just that the database takes in only the first line. So I guess there is a setting problem with my database? I don't understand though, b/c I set more than enough for the size. Could it be b/c I am using varchar as the datatype?

Thank you.

Leon






Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in inserting data in gridview deb_kareng ASP.NET 2.0 Professional 0 August 22nd, 2007 02:07 AM
problem in inserting data monikanit ASP.NET 1.x and 2.0 Application Design 1 July 30th, 2007 02:48 AM
mysterious problem (data no inserting ) gratisaccount VB.NET 2002/2003 Basics 1 June 29th, 2006 08:48 AM
PROBLEM Inserting data into 2 tbls that r JOINED shyster1977 Classic ASP Databases 2 March 10th, 2005 10:40 AM
Problem inserting with data adapter cridley ADO.NET 1 February 22nd, 2005 05:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.