Line Breaks break my form! ODBC Driver doesn't swallow %0d%0aRSS

1 reply

Last post Jun 12, 2004 08:32 AM by Ken Schaefer

  • Line Breaks break my form! ODBC Driver doesn't swallow %0d%0a

    Jun 11, 2004 09:44 AM|kosmoraios|LINK

    Help is greatly appreciated. Many Karma points will be awarded. I have an ASP form that inputs data into a FoxPro free table (dbf). The "details" field is a memo field where the user should be able to enter unlimited data. The form works great, except: 1.) when there is a line break (enter) anywhere in the field 2.) when you exceed 254 characters. I get this error: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Visual FoxPro Driver]Command contains unrecognized phrase/keyword. I understand that the ODBC driver is not swallowing my the line break correctly. In the post, the line break is: %0D%0A Here's what I tried to replace it - I'm not sure if it's even correct: strDetails=Request.Form("Details") strDetails=Replace(Request("Details"),Chr13,"
    How could I replace the line break with something that the ODBC driver will eat? Or is there another solution? My code is as follows: MM_editAction = CStr(Request("URL")) If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Request.QueryString End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_editQuery = "" %>
  • Re: Line Breaks break my form! ODBC Driver doesn't swallow %0d%0a

    Jun 12, 2004 08:32 AM|Ken Schaefer|LINK

    A line break is: Chr(13) & Chr(10) not Chr13. strMyField = Replace(strMyField, Chr(13) & Chr(10), "
    ") You can also use VB's constants for this: vbCrLf = Chr(13) & Chr(10) vbCr = Chr(13) vbLf = Chr(10) When passing these things in the URL, they are URLEncoded. %0D = 13, and %0A = 10 (the URLEncoded values are in Hex) Cheers Ken