If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP request.form variable content truncates at space in

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-31-04, 02:04
svgiles svgiles is offline
Registered User
 
Join Date: Oct 2004
Posts: 10
Question ASP request.form variable content truncates at space in

Please help! I am using data from a form to insert into an Access database record. The value for one of the fields is set automatically based on the value of a querystring that is passed through the URL. I know it passed correctly because when I include a troubleshooting line in my code:
<%response.write(request.querystring("house"))%>
it prints out correctly.
The querystring value is then collected in a form thusly:
<input type="hidden" name="txthouse" size="30" maxlength="50"
value=<%=request.querystring("house")%>
However, when the value is put into the database via the
(request.form("txthouse")) variable the information is truncated at the first space. In other words if the value is "Saint Clair", the value inserted into the database is only "Saint". I have been researching this for days and have run out of ideas. Any help would be indescribably appreciated!!!!!
Reply With Quote
  #2 (permalink)  
Old 10-31-04, 17:10
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
woudl you like to post all of the code relating to the datbase insert so we can get a better idea of how this is all working?
Reply With Quote
  #3 (permalink)  
Old 10-31-04, 18:06
svgiles svgiles is offline
Registered User
 
Join Date: Oct 2004
Posts: 10
Yes! - here is the insert code

Hi - Yes - here is the insert code. The field in question is the last one (txthouse) whose value it taken from <%=request.querystring("house")%>
Your help is immensely appreciated!

strSql="Insert into [residents](enteredby,dateentered,firstname,lastname,house) values( "& "'" & replace(request.form("txtenteredby"),"'","''") & "',"& "'" & replace(request.form("txtdateentered"),"'","''") & "',"& "'" & replace(request.form("txtfirstname"),"'","''") & "',"& "'" & replace(request.form("txtlastname"),"'","''") & "',"& "'" & replace(request.form("txthouse"),"'","''") & "')"

conn.open mydsn

conn.execute(strsql)

conn.close

set conn=nothing
Reply With Quote
  #4 (permalink)  
Old 10-31-04, 18:32
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
doh! missed the fault. it was in your first post...
Code:
<input type="hidden" name="txthouse" size="30" maxlength="50"
value="<%=request.querystring("house")%>">
Reply With Quote
  #5 (permalink)  
Old 10-31-04, 22:36
svgiles svgiles is offline
Registered User
 
Join Date: Oct 2004
Posts: 10
Talking Thank You Rokslide!!

Holy cow! You're the greatest! I have been working on this problem for two days and the answer comes down to a set of quotes - go figure.
I am very, very grateful for your help!!
Reply With Quote
  #6 (permalink)  
Old 10-31-04, 22:37
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
no worries, happy to help out. drop by if you need a hand with anything else.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On