Ir para conteúdo

POWERED BY:

Arquivado

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

FoX Borland

Uso inválido de Null: 'Replace'

Recommended Posts

olá pessoal

 

estou tentando fazer o replace pra fazer a linha do texto do campo de mensagens quebrar...

alguém pode me ajudar??

 

coloquei desta forma

 

<%response.write Replace(recados("msg"), vbCrlf, "<br>")%>

 

e parece este erro

 

 

Tipo de erro:

Erro de tempo de execução do Microsoft VBScript (0x800A005E)

Uso inválido de Null: 'Replace'

/spiando/layout/index_mural.asp, line 85

 

 

<%@LANGUAGE="VBSCRIPT"%><!--#include file="../Connections/mural.asp" --><%Dim recadosDim recados_numRowsSet recados = Server.CreateObject("ADODB.Recordset")recados.ActiveConnection = MM_mural_STRINGrecados.Source = "SELECT * FROM Mural ORDER BY data DESC"recados.CursorType = 0recados.CursorLocation = 2recados.LockType = 1recados.Open()recados_numRows = 0%><%Dim Repeat1__numRowsDim Repeat1__indexRepeat1__numRows = 5Repeat1__index = 0recados_numRows = recados_numRows + Repeat1__numRows%><html><head><title></title><script language=JavaScript1.2>//<iframe> script by Dynamicdrive.com//Specify speed of scroll. Larger=faster (ie: 5)var scrollspeed=cache=1function initialize(){marqueeheight=document.all? parent.document.all.datamain.height : parent.document.getElementById("datamain").getAttribute("height")dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")dataobj.style.top=5thelength=dataobj.offsetHeightscrolltest()}function scrolltest(){dataobj.style.top=parseInt(dataobj.style.top)-scrollspeedif (parseInt(dataobj.style.top)<thelength*(-1))dataobj.style.top=5setTimeout("scrolltest()",50)}window.onload=initialize</SCRIPT><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><!--@import url("estyle.css");body {	background-color: #BBBBBB;}--></style></head><body><table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%" align="center">  <tr>	<td align="center" valign="middle"><DIV id=datacontainer style="LEFT: 0px; WIDTH: 100%; POSITION: absolute; TOP: 200px">		<p><br />		  <% While ((Repeat1__numRows <> 0) AND (NOT recados.EOF)) %>		<table width="347" border="0" cellspacing="1" cellpadding="5" align="center" background="../images/bg_table4.gif">		  <tr>			<td width="50%" bgcolor="#C8C8C8"><span class="style2">De:</span> <span class="style1"><%=(recados.Fields.Item("nome").Value)%></span> <span class="style1">(<a class="style1" href="mailto:<%=(recados.Fields.Item("email").Value)%>"><%=(recados.Fields.Item("email").Value)%></a>)</span></td>			<td width="50%" bgcolor="#C8C8C8"><span class="style2">Para:</span> <span class="style1"><%=(recados.Fields.Item("para").Value)%></span></td>		  </tr>		  <tr>			<td colspan="2"><span class="style6"><%response.write Replace(recados("msg"), vbCrlf, "<br>")%></span><br />			</td>		  </tr>		  <tr>			<td colspan="2" bgcolor="#C8C8C8"><div align="right"><span class="style6"><%=(recados.Fields.Item("data").Value)%><br />				<%=(recados.Fields.Item("cidade").Value)%></span></div></td>		  </tr>		</table>		<br />		<%   Repeat1__index=Repeat1__index+1  Repeat1__numRows=Repeat1__numRows-1  recados.MoveNext()Wend%>		</p>	  </DIV></td>  </tr></table></body></html><%recados.Close()Set recados = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

O campo "msg" está vazio.

Compartilhar este post


Link para o post
Compartilhar em outros sites

faça uma verificação antes, talvez resolva,

 

<%If Not IsNULL(recados("msg")) OR Trim(recados("msg")) <> "" Then	 response.write Replace(recados("msg"), vbCrlf, "<br>")Else	 response.write "nenhum recado"End If

 

Junior

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.