Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/08/2002, 07:38
Avatar de CHuLoSoY
CHuLoSoY
 
Fecha de Ingreso: febrero-2002
Ubicación: Ribeira (Galicia)
Mensajes: 1.900
Antigüedad: 23 años, 3 meses
Puntos: 29
Cambio por <br> ERROR

Fíjense en la línea marcada en negrita cursiva:

Código:
&lt;%
Response.Buffer = true
dim cnn,rst
' Creamos la conexión a la base de datos sin DSN
set cnn = Server.CreateObject(&quot;ADODB.Connection&quot;)
set rst = Server.CreateObject(&quot;ADODB.RecordSet&quot;)
cnn.Open(&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; &amp; _
Server.MapPath(&quot;*********.mdb&quot;))
sqltext = &quot;SELECT * FROM Noticias&quot;
rst.Open sqltext,cnn,3,3

texto = replace(rst(&quot;noticia&quot;), CHR(013), &quot;&lt;br&gt;&quot;)  

'Recogemos los datos y validamos que no haya ningun campo vacio
dim titulo, copete, noticia
titulo = Request.Form(&quot;titulo&quot;)
copete = Request.Form(&quot;copete&quot;)
noticia = texto
categoria = Request.Form(&quot;categoria&quot;)
fecha = now()
img = Request.Form(&quot;img&quot;)
autor = Request.Form(&quot;autor&quot;)

if copete = &quot;&quot; or titulo =&quot;&quot; or noticia =&quot;&quot; or categoria =&quot;&quot; or img =&quot;&quot; or autor =&quot;&quot; then
error = &quot;Debe completar todos los datos.&quot;
Response.Write error
Response.End
end if

'Si está todo correcto, procedemos a ingresar los datos a la base de datos

rst.AddNew
rst(&quot;titulo&quot;) = titulo
rst(&quot;copete&quot;) = copete
rst(&quot;noticia&quot;) = noticia
rst(&quot;categoria&quot;) = categoria
rst(&quot;fecha&quot;) = fecha
rst(&quot;img&quot;) = img
rst(&quot;autor&quot;) = autor
rst.update

'Terminamos e imprimimos un mensaje
Response.Write &quot;La noticia se ha ingresado con exito&quot;
%&gt;
Eso está bien? Es que no me cambia por &lt;br&gt; las líneas.

<center><hr size="1" color="blue" width="39%"><a href="http://www.ommadawn.es.vg" target="_blank"><font color="red">www.Ommadawn.es.vg[/CODE]</a><hr size="1" color="blue" width="39%">