Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 28th, 2004, 06:29 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
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: phungleon@hotmail.com

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


Reply With Quote
  #2 (permalink)  
Old July 28th, 2004, 07:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #3 (permalink)  
Old July 28th, 2004, 08:05 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
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"),"'", "''")) & "'"



Reply With Quote
  #4 (permalink)  
Old July 28th, 2004, 08:08 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
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

Reply With Quote
  #5 (permalink)  
Old July 28th, 2004, 08:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #6 (permalink)  
Old July 28th, 2004, 08:22 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
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.

Reply With Quote
  #7 (permalink)  
Old July 28th, 2004, 08:29 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
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?

Reply With Quote
  #8 (permalink)  
Old July 28th, 2004, 08:30 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #9 (permalink)  
Old July 28th, 2004, 08:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #10 (permalink)  
Old July 29th, 2004, 11:11 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 03:07 AM
problem in inserting data monikanit ASP.NET 1.x and 2.0 Application Design 1 July 30th, 2007 03:48 AM
mysterious problem (data no inserting ) gratisaccount VB.NET 2002/2003 Basics 1 June 29th, 2006 09: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



All times are GMT -4. The time now is 02:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.