Código:
el tema es que querrian que me respetara los saltos de lines del textarea y que solo me mostrara la fila de la tabla del link en el caso de que link tuviera contenido. +sabeis como lo puedo hacer<% Response.Buffer = true dim cnn,rst ' Creamos la conexión a la base de datos sin DSN set cnn = Server.CreateObject("ADODB.Connection") set rst = Server.CreateObject("ADODB.RecordSet") cnn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/cgi-bin/productos.mdb")) sqltext = "SELECT * FROM productos" rst.Open sqltext,cnn,3,3 'Recogemos los datos y validamos que no haya ningun campo vacio dim modelo, specs, link modelo = Request.Form("modelo") specs = Request.Form("specs") namm07 = Request.Form("link") if modelo = "" or specs = "" link = ""then error = "Faltan datos" Response.Write error Response.End end if 'Si está todo correcto, procedemos a ingresar los datos a la base de datos rst.AddNew rst("modelo") = modelo rst("specs") = specs rst("link") = link rst.update 'Terminamos e imprimimos un mensaje Response.Write("Todo ok") %> <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>EDIROL Iberia</title> </head> <body bgcolor="#FFFFFF"> <form method="POST" action="alta_producto.asp"> <table> <tr> <td>producto</td> <td><input name="modelo" size="40"></td> </tr> <tr> <td>specs</td> <td><textarea name="specs" cols=50 rows=14></textarea> </font></td> </tr> <tr> <td>link</td> <td><input name="link" size="40"></font></td> </tr> <tr> <td><input type="submit" value="Dar de Alta" name="enviar" style="font-family: Verdana"></font></td> </tr> </table> </body> </html>
Código:
<% 'Dimension variables Dim adoCon Dim rsGuestbook Dim strSQL Set adoCon = Server.CreateObject("ADODB.Connection") ado.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/cgi-bin/productos.mdb")) 'Set an active connection to the Connection object using DSN connection 'adoCon.Open "DSN=guestbook" Set rsGuestbook = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM edirol order by modelo asc;" rsGuestbook.Open strSQL, adoCon 'Loop through the recordset Do While not rsGuestbook.EOF 'escribeo la tabla Response.Write ("<center><TABLE BORDER=1 WIDTH=500>") Response.Write ("<TR><td>" & rsGuestbook("modelo") & "</Td>") Response.Write ("<td><a href=" & rsGuestbook("link") & "></a></td>") Response.Write ("<td>" & rsGuestbook("specs") & ""</td></TR>) 'Move to the next record in the recordset rsGuestbook.MoveNext Loop 'Reset server objects rsGuestbook.Close Set rsGuestbook = Nothing Set adoCon = Nothing %>