 |
| 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
|
|
|
|

July 28th, 2004, 05:29 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

July 28th, 2004, 06:51 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Can you post your code related to textarea and storing data into db?
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

July 28th, 2004, 07:05 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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"),"'", "''")) & "'"
|
|

July 28th, 2004, 07:08 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

July 28th, 2004, 07:12 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

July 28th, 2004, 07:22 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

July 28th, 2004, 07:29 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

July 28th, 2004, 07:30 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

July 28th, 2004, 07:33 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

July 29th, 2004, 10:11 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |