|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Cant add more than one word to database record
My page takes inputted text from the user and adds it to a record in the database. Only the first word is added to the field if more words are entered. The field type is nvarchar so I dont understand why it wont capture the rest of the text. My statement looks like: SQL = "Insert into Individual (AirRequest) Values('" & Request.Form("AirRequest") & "')". What am I doing wrong? I just discovered it does this for all of the text inputs that my form contains. All multiple word inputs are adding only the first word to the field. Am I using the wrong field type? I have another page that is almost identical but it is inserting all words entered in the text boxes. I cant find a difference in the codes.
|
|
#2
|
||||
|
||||
|
What is the length of the field in the database?
What is the length of the text you are trying to enter? What does the sql statement display when you do a response.write on it? |
|
#3
|
|||
|
|||
|
Quote:
The length of the db field is 500. The length of the text is anything over one word, it does not matter what length. There are 3 pages: the first takes in all the info from the user, the next simply spits out the inputted info just as a confirmation, then the third actually submits it to the db and spits out what should look just like what was shown on the confirmation but at this point it is actually displaying what has been inserted using rs("AirRequest"). On the confirmation page(the page just before the insert to db page) I did a response.write(Request.Form("AirRequest")) at the very end of the page. It came back with all of the words I entered in that text box. Then I did the Response.Write at the very beginning of the next page that inserts the record. It did not contain the rest of the text after the first word. There has been no data manipulation at this point, just simply carrying the value from one page to the next and it's losing data. Its driving me crazy! |
|
#4
|
||||
|
||||
|
does the text contain any special characters? such as (') or (")?
what are the words that are needing to be entered? And What is actually being shown and entered into the database? |
|
#5
|
|||
|
|||
|
Quote:
I entered the following text into the text box: Why wont you work for the love. On the confirmation page it all comes through but then I click continue and what is entered in the DB as well as shown on the final page is just: Why But whatever I enter in the text box the only thing that finally goes through is the first word. |
|
#6
|
|||
|
|||
|
Quote:
Just wanted to reiterate that this problem is happening before it even hits the DB and tries to insert. I did the response.write on the final page before the SQL connection and it still came back with just the one word. Then I did it at the end of the confirmation page just before it and all the words were there. So carrying the value from one page to the next is somehow making it drop all words after the first. thanks for your help |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Cant add more than one word to database record |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|