SQL Text Field (INSERT vs UPDATE)

Results 1 to 2 of 2

Thread: SQL Text Field (INSERT vs UPDATE)

  1. #1
    Mark Chance Guest

    Default SQL Text Field (INSERT vs UPDATE)

    I&#039m having a problem with updating a SQL Text field through a stored procedure from an ASP page. When initially inserting the data, there is no problem, but when I try to update the data in the text field I get the following error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e57&#039 <BR>[Microsoft][ODBC SQL Server Driver]String data, right truncation <BR><BR>Turns out that if the length of the string being passed is larger than 255 characters, the above error is generated.<BR><BR>The sp parameter is created in the asp as:<BR><BR>Comment_UPD.CreateParameter("@txtCommen t", adVarChar, adParamInput, 2147483647)<BR><BR>Which works for inserting the initial comment, but fails trying to update.<BR><BR>Anyone have any suggestions?<BR><BR>Mark Chance<BR>

  2. #2
    Mark Chance Guest

    Default RE: SQL Text Field (INSERT vs UPDATE)[Solved]

    Just so everyone knows, when you are inserting or updating a SQL Text field, a SQL text field is just a pointer to a linked list that contains your data. If you want to insert or update this information, you can&#039t pass the string literal, you have to pass a pointer to the string which is done with adLongVarChar so the parameter definition should have been:<BR><BR>Comment_UPD.CreateParameter("@txtComm ent", adLongVarChar, adParamInput, 2147483647)<BR><BR>The error 80040e57 is:<BR><BR>Constant value “constant” overflowed.<BR><BR>A literal value in the command text could not be stored in the type specified by the associated column.<BR><BR>Hope this helps someone in the future.<BR><BR>Mark Chance

Posting Permissions

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