Closed Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 21

Thread: Type mismatch: HTMLEncode

  1. #11
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Yeap, post what you have thus far and we can work out the kinks
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  2. #12
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Thanks JMurrayhead,

    Here is the code for the comments field on the EDIT view (sorry this one is comment vs RolloutComments in the 1st post but its the exact thing). This is the screen that shows it cut off after the double quotes.

    Code:
    <TD><input class="clrBg" type="text" tabIndex="26" name="Comments<%response.write(i)%>" size="200" maxlength="200" value="<%= rs("Comments") %>"</TD>
    
    Just posting the code below for the search results screen just so you know what I have there - on this screen it shows the whole comment.

    Code:
    <TD><%=rs("Comments")%> &nbsp;</TD>
    

  3. #13
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    You have a maxlength set for 200 characters. Is it possible the text you are outputting is longer?

    Otherwise, post your insert code so we can determine the problem from there.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  4. #14
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Ok, checked my table and is set to varchar 200. and i checked, I'm not entering more than 200. I can enter something like - 8" Hammer tool and it will add it to the database with no problems, it's only when I get back to my edit screen it will show only 8 and cut off the " Hammer tool. It's like it's there but not showing in the text box.

    Below is the insert code:

    Code:
    <%
    
    Set rs = Server.CreateObject("ADODB.Recordset")
    
    'build SQL
    sSql = "update tblList set RegionID = " & strRegionID & ", DistrictID= " & strDistrictID & ", CatID= '" & strCatID & "',ALSize= '" & strALSize & "', ItemDesc = '" & strItemDesc & "', ToolNum = '" & strToolNum & "', EQNum = '" & strEquip & "', ETA = '" & strETA & "', DateShip = convert(datetime, '" & strDateShip & "'), Comments = '" & ValidateStr(strComments) & "', DateOrd = '" & strDateOrd & "', Vendor = '" & strVendor & "', CollarUSD = convert(money, '" & strCollarUSD & "'), TaxUSD = convert(money, '" & strTaxUSD & "'), Cost = convert(money, '" & strCost & "')"
    sSql = sSql & " WHERE ListID = " & sListID & " "
    
    
    	rs.Open sSql, Conn, 3, 1
    
    
    nCounter = nCounter + 1
    sListID = Request("ListIDRow" & nCounter)
    
    Loop
    
    response.redirect "SearchResults.asp"
    
    Conn.Close
    Set Conn = Nothing
    
    %>
    

  5. #15
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Okay, so maybe we do need to double up the double quotes. So change that function to this:

    Code:
    Function ValidateStr(strValue)
        strTemp = strValue
        strTemp = Trim(strTemp)
        strTemp = Replace(strTemp,"'","''")
        strTemp = Replace(strTemp, chr(34), chr(34) & chr(34))
        ValidateStr = strTemp
    End Function
    
    Try running this now.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  6. #16
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Thanks JMurrayhead,

    hmm...that made this 8" Hammer into 8"" Hammer when added to the database.
    But when I got back in the edit mode, it still only made 8.

  7. #17
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Remove the extra code I added to that function and post the code you're using to output the data to the screen.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  8. #18
    Super Sarcasm Mistress mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere's Avatar
    Join Date
    Mar 2008
    Location
    Wide Awake In Dreamland
    Posts
    830
    Rep Power
    8

    don't change the quote when inserting, but when you display it ... use this
    Code:
    function checkOutTxt(strValue)
         checkOutTxt = replace(strValue,"""","&quot;")
    end function
    
    <TD><input class="clrBg" type="text" tabIndex="26" name="Comments<%response.write(i)%>" size="200" maxlength="200" value="<%= checkOutTxt(rs("Comments")) %>"</TD>
    
    Quote of the Month:
    INSIGHT: When the going gets tough, the tough get going. The smart left a long time ago.

    Questions to Ponder:
    Are people more violently opposed to fur rather than leather because it's much easier to harass rich women than motorcycle gangs?

    iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
    copyright © 2008 sbenj69

    Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.

  9. #19
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Hi JMurrayhead,

    Ok, that was the code I posted yesterday .... I noticed I was using double quotes around the rs value, I changed that to single and it looks like it's working now.....I can see the whole comment 8" Hammer in edit view.

    See in red.

    Code:
    <TD><input class="clrBg" type="text" tabIndex="26" name="Comments<%response.write(i)%>" size="200" maxlength="200" value='<%= rs("Comments") %>'</TD>
    
    Thank you for your help with this!

  10. #20
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Thanks Mehere!!!
    That was it!!!
    Works well!!!

Closed Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast

Similar Threads

  1. Data Type Mismatch in Criteria Expression
    By alansidman in forum Microsoft Access
    Replies: 1
    Last Post: April 9th, 2008, 05:33 PM

Bookmarks

Posting Permissions

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

SEO by vBSEO