Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

wwmiga

limite de caracteres

Recommended Posts

Ai Galera estou com um problema tenho uma aplicacao em asp com sql com 3 campos de historicos Ex. Historico1Historico2Historico3Cada um com 8000 caracter que e o limite do SQL porem quando eu mando o codigo gravar ele junta o do 1 com o do 2 com o do 3 e da estouro de limite.Eu to ahcando que na hora de gravar ele junta tudo e da mais de 8000 como posso fazer pra ele gravar nao dar esse erro tipo eu digitei so no historico2 ele salvar so no 2 , Ou Alguma solucao Grato

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ok deixa eu tentar explicar melhor

O cliente esta digitando no historico1 ai eu o limite e ele comeca a digital no historico2 , mais quando mando gravar nao sei porque o sistema pega e soma os valores e da erro de limite

-----------------------------------------

Tipo de erro:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)

[Microsoft][ODBC SQL Server Driver]

Cannot create a row of size 8094 which is greater than the allowable maximum of 8060.

/tk/update1.tk.asp, line 133

 

segue abaixo o codigo

 

<%@LANGUAGE="VBSCRIPT"%><% Session.LCID = 1033 %><%Session("pg") = Request.QueryString("pg")%><%' *** Restrict Access To Page: Grant or deny access to this pageMM_authorizedUsers=""MM_authFailedURL="../erro.asp"MM_grantAccess=falseIf Session("MM_Username") <> "" Then  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _		 (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then	MM_grantAccess = true  End IfEnd IfIf Not MM_grantAccess Then  MM_qsChar = "?"  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"  MM_referrer = Request.ServerVariables("URL")  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)  Response.Redirect(MM_authFailedURL)End If%><!--#include file="../Connections/Conexao.asp" --><%' *** Edit Operations: declare variablesDim MM_editActionDim MM_abortEditDim MM_editQueryDim MM_editCmdDim MM_editConnectionDim MM_editTableDim MM_editRedirectUrlDim MM_editColumnDim MM_recordIdDim MM_fieldsStrDim MM_columnsStrDim MM_fieldsDim MM_columnsDim MM_typeArrayDim MM_formValDim MM_delimDim MM_altValDim MM_emptyValDim MM_iMM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))If (Request.QueryString <> "") Then  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)End If' boolean to abort record editMM_abortEdit = false' query string to executeMM_editQuery = ""%><%' *** Update Record: set variablesIf (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then  MM_editConnection = MM_Conexao_STRING  MM_editTable = "dbo.tbl_cliente"  MM_editColumn = "id_cliente"  MM_recordId = "" + Request.Form("MM_recordId") + ""  MM_editRedirectUrl = "../alterandotk.asp"  MM_fieldsStr  = "historico01|value|historico02|value|historico03|value|dt_anotacao|value|dt_retorno|value|Prioridade|value"  MM_columnsStr = "historico01|',none,''|historico02|',none,''|historico03|',none,''|dt_anotacao|',none,NULL|dt_retorno|',none,NULL|Prioridade|',none,''"  ' create the MM_fields and MM_columns arrays  MM_fields = Split(MM_fieldsStr, "|")  MM_columns = Split(MM_columnsStr, "|")    ' set the form values  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2	MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))  Next  ' append the query string to the redirect URL  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then	If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then	  MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString	Else	  MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString	End If  End IfEnd If%><%' *** Update Record: construct a sql update statement and execute itIf (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then  ' create the sql update statement  MM_editQuery = "update " & MM_editTable & " set "  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2	MM_formVal = MM_fields(MM_i+1)	MM_typeArray = Split(MM_columns(MM_i+1),",")	MM_delim = MM_typeArray(0)	If (MM_delim = "none") Then MM_delim = ""	MM_altVal = MM_typeArray(1)	If (MM_altVal = "none") Then MM_altVal = ""	MM_emptyVal = MM_typeArray(2)	If (MM_emptyVal = "none") Then MM_emptyVal = ""	If (MM_formVal = "") Then	  MM_formVal = MM_emptyVal	Else	  If (MM_altVal <> "") Then		MM_formVal = MM_altVal	  ElseIf (MM_delim = "'") Then  ' escape quotes		MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"	  Else		MM_formVal = MM_delim + MM_formVal + MM_delim	  End If	End If	If (MM_i <> LBound(MM_fields)) Then	  MM_editQuery = MM_editQuery & ","	End If	MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal  Next  MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId  If (Not MM_abortEdit) Then	' execute the update	Set MM_editCmd = Server.CreateObject("ADODB.Command")	MM_editCmd.ActiveConnection = MM_editConnection	MM_editCmd.CommandText = MM_editQuery	MM_editCmd.Execute	MM_editCmd.ActiveConnection.Close	If (MM_editRedirectUrl <> "") Then	  Response.Redirect(MM_editRedirectUrl)	End If  End IfEnd If%><%Dim Cliente__MMColParamCliente__MMColParam = "1"If (Request.QueryString("id_cliente") <> "") Then   Cliente__MMColParam = Request.QueryString("id_cliente")End If%><%Dim ClienteDim Cliente_numRowsSet Cliente = Server.CreateObject("ADODB.Recordset")Cliente.ActiveConnection = MM_Conexao_STRINGCliente.Source = "SELECT * FROM dbo.tbl_cliente WHERE id_cliente = " + Replace(Cliente__MMColParam, "'", "''") + ""Cliente.CursorType = 0Cliente.CursorLocation = 2Cliente.LockType = 1Cliente.Open()Cliente_numRows = 0%><%Dim VendedorDim Vendedor_numRowsVendedor__MMColParam = (Cliente.Fields.Item("id_vendedor").Value)Set Vendedor = Server.CreateObject("ADODB.Recordset")Vendedor.ActiveConnection = MM_Conexao_STRINGVendedor.Source = "SELECT * FROM dbo.tbl_vendedor WHERE id_vendedor = " + Replace(Vendedor__MMColParam, "'", "''") + ""Vendedor.CursorType = 0Vendedor.CursorLocation = 2Vendedor.LockType = 1Vendedor.Open()Vendedor_numRows = 0%><%Dim RamoDim Ramo_numRowsRamo__MMColParam = (Cliente.Fields.Item("id_ramo").Value)Set Ramo = Server.CreateObject("ADODB.Recordset")Ramo.ActiveConnection = MM_Conexao_STRINGRamo.Source = "SELECT * FROM dbo.tb_ramo WHERE id_ramo = " + Replace(Ramo__MMColParam, "'", "''") + ""Ramo.CursorType = 0Ramo.CursorLocation = 2Ramo.LockType = 1Ramo.Open()Ramo_numRows = 0%><html><head><title>[ JHM Máquinas ]</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="../jhm.css" rel="stylesheet" type="text/css"><script language="JavaScript1.2" src="../js/popcalendar1.js" type='text/javascript'></script></head><body><table width="650"  border="1" align="center" cellpadding="3" cellspacing="0" style="border-collapse:collapse; "><form name="form1" method="POST" action="<%=MM_editAction%>">  <tr>	<td colspan="3" class="tittabela">ALTERA ANOTAÇÃO	  </td>  </tr>  <tr>	<td width="18%" align="right" class="coluna">Cliente: </td>	<td width="82%" colspan="2"><%=(Cliente.Fields.Item("cliente").Value)%></td>  </tr>  <tr>	<td align="right" class="coluna">CNPJ/CPF</td>	<td colspan="2"><%=(Cliente.Fields.Item("cnpj_cpf").Value)%></td>  </tr>  <tr>	<td align="right" class="coluna">Contato:</td>	<td colspan="2"><%=(Cliente.Fields.Item("contato").Value)%></td>  </tr>  <tr>	<td align="right" class="coluna">Endereço:</td>	<td colspan="2"><%=(Cliente.Fields.Item("endereco").Value)%> - <%=(Cliente.Fields.Item("numero").Value)%> - <%=(Cliente.Fields.Item("comple").Value)%> - <%=(Cliente.Fields.Item("bairro").Value)%> - <%=(Cliente.Fields.Item("cidade").Value)%> - <%=(Cliente.Fields.Item("estado").Value)%>- CEP- <%=(Cliente.Fields.Item("cep").Value)%></td>  </tr>  <tr>	<td align="right" class="coluna">Email:</td>	<td colspan="2"><a href="mailto:<%=(Cliente.Fields.Item("email").Value)%>"><%=(Cliente.Fields.Item("email").Value)%></a></td>	</tr>  <tr>	<td align="right" class="coluna"> Telefone:</td>	<td><%=(Cliente.Fields.Item("tel").Value)%> </td>	<td><%=(Cliente.Fields.Item("fax").Value)%></td>  </tr>  <tr>	<td align="right" class="coluna">Atendido por :</td>	<td colspan="2"><%=(Vendedor.Fields.Item("Nome").Value)%></td>  </tr>  <tr>	<td align="right" class="coluna">Ramo de Atividade: </td>	<td><%=(Ramo.Fields.Item("Ramo").Value)%><span class="tittabela">	</span></td>	<td><span class="tittabela">	  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="131" height="28">		<param name="movie" value="indicação.swf">		<param name="quality" value="high">		<embed src="indicação.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="131" height="28"></embed>	  </object>	</span></td>  </tr>  <tr>	<td align="right" class="coluna">Histórico 01: </td>	<td colspan="2"><textarea name="historico01" cols="95" rows="7" ><%=(Cliente.Fields.Item("historico01").Value)%></textarea></td>  </tr>  <tr>	<td align="right" class="coluna">Histórico 02:</td>	<td colspan="2"><textarea name="historico02" cols="95" rows="7" ><%=(Cliente.Fields.Item("historico02").Value)%></textarea></td>  </tr>  <tr>	<td align="right" class="coluna">Histórico 03:</td>	<td colspan="2"><textarea name="historico03" cols="95" rows="7" id="historico03" ><%=(Cliente.Fields.Item("historico03").Value)%></textarea></td>  </tr>  <tr>	<td height="30" align="right" class="coluna">Dt. Anotação: </td>	<td colspan="2"><input name="dt_anotacao1" type="text" id="dt_anotacao1" value="<%=Day(Cliente.Fields.Item("dt_retorno").Value)&"/"&Month(Cliente.Fields.Item("dt_retorno").Value)&"/"&Year(Cliente.Fields.Item("dt_retorno").Value)%>"  size="10" maxlength="30">	  <input name="dt_anotacao" type="hidden" id="dt_anotacao" value="<%=(Cliente.Fields.Item("dt_retorno").Value)%>"></td>  </tr>  <tr>	<td height="30" align="right" class="coluna">Dt Retorno:</td>	<td colspan="2"><input name="dt_retorno" type="text"  size="10" maxlength="30">	  <input name="button" type="button" class="botao" onClick="popUpCalendar(dt_retorno, dt_retorno, 'mm/dd/yyyy');" value="v"></td>  </tr>  <tr>	<td align="right" class="coluna">Prioridade:</td>	<td colspan="2" class="coluna"><input <%If (CStr((Cliente.Fields.Item("Prioridade").Value)) = CStr("B")) Then Response.Write("CHECKED") : Response.Write("")%> name="Prioridade" type="radio" class="noborder" value="B">	  <span class="baixa">Baixa</span>	  <input <%If (CStr((Cliente.Fields.Item("Prioridade").Value)) = CStr("N")) Then Response.Write("CHECKED") : Response.Write("")%> name="Prioridade" type="radio" class="noborder" value="N">Normal <input <%If (CStr((Cliente.Fields.Item("Prioridade").Value)) = CStr("A")) Then Response.Write("CHECKED") : Response.Write("")%> name="Prioridade" type="radio" class="noborder" value="A"> <span class="alta">Alta</span></td>  </tr>  <tr>	<td colspan="3" align="right" class="coluna"><div align="center">		<input name="Button" type="button" class="botao" value="Alterar"  onClick="Datas1();">	</div></td>  </tr>  <input type="hidden" name="MM_update" value="form1">  <input type="hidden" name="MM_recordId" value="<%= Cliente.Fields.Item("id_cliente").Value %>"></form></table><script>		function Datas1(){		if(document.form1.dt_retorno.value == '' || document.form1.dt_retorno.value == null)				{				alert('Campo de preenchimento obrigatotio.');				document.form1.dt_retorno.focus();				return false;				}				document.form1.submit();				}		</script></body></html><%Cliente.Close()Set Cliente = Nothing%><%Vendedor.Close()Set Vendedor = Nothing%><%Ramo.Close()Set Ramo = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

isso mesmo sao 3 campos de historico , pois como o limite do sql é de 8000 e 8000 caracter e pouco ai eu divide em 3 de 8000 , mas na hora de gravar ela da esse pau

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.