Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2004
    Posts
    10

    Question Unanswered: 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!!!!!

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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?

  3. #3
    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

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    doh! missed the fault. it was in your first post...
    Code:
    <input type="hidden" name="txthouse" size="30" maxlength="50"
    value="<%=request.querystring("house")%>">

  5. #5
    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!!

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    no worries, happy to help out. drop by if you need a hand with anything else.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •