| | |
Help with script asp
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 93
Reputation:
Solved Threads: 0
I have the following script from a forum that collected data from a form and inserted in the. Mdb
These are displayed through a file that reads the database.
At this time the display is text, URLs are not active.
The script is not so do not really know what to do.
I need that URLs appear as a link at this time does not happen.
Can you help me?
<%
IdMensaje = Request.QueryString("IdMensaje")
busca = Trim(Request.QueryString("busca"))
Set oConn = Server.CreateObject ("ADODB.Connection")
Set RS = Server.CreateObject ("ADODB.RecordSet")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&Server.MapPath(".private//usuarios.mdb")
sql = "SELECT * FROM discusion WHERE IdMensaje="&IdMensaje&""
Rs.Open sql, oConn, 1, 1
mensaje = RS("mensaje")
%>
<img src="anadir.gif" width="16" height="16"> <A HREF="contestar.asp?idmensaje=<%=IdMensaje%>"><B>Contestar
este mensaje</B></A><BR>
<BR>
<%'=== Muestro el mensaje padre. La pregunta inicial ======
Response.Write "<B>Nombre: </B>"&RS("name")&"<BR>"
Response.Write "<B>Email: </B>"&RS("mail")&"<BR>"
Response.Write "<B>Título del mensaje: </B>"&RS("Title")&"<BR>"
Response.Write "<B>Mensaje: </B><BR><P><I>"& AcomodarTXT(mensaje)&"</I></P>"
Response.Write "<HR WIDTH=""80%"">"
'===== Fin pregunta inicial ===== Set RS2 = Server.CreateObject ("ADODB.RecordSet")
sql2 = "SELECT * FROM discusion WHERE IdCabeza="&IdMensaje &" ORDER BY fecha"
RS2.Open sql2, oConn, 1, 1
'===== Respuestas a la pregunta inicial
Do While not RS2.EOF
mensaje2 = RS2("mensaje")
Response.Write "<BR><B>Nombre: </B>"&RS2("name")&"<BR>"
Response.Write "<B>Email: </B>"&RS2("mail")&"<BR>"
Response.Write "<B>Título del mensaje: </B>"&RS2("title")&"<BR>"
Response.Write "<B>Mensaje: </B><BR>"%><P><I><%= AcomodarTXT(mensaje2)%></I></P><BR>
<%
Response.Write "<HR WIDTH=""80%"">"
RS2.MoveNext
Loop
'===== Fin de respuestas ======
RS2.Close
Set RS2 = nothing
RS.Close
oConn.Close
Set RS = nothing
Set oConn = nothing
Function AcomodarTXT(txt)
txt = Replace (txt, "<", "<")
txt = Replace (txt, ">", ">")
txt = Replace (txt, vbCrLf, "<BR>")
txt = Replace (txt, "''", "'")
acomodarTXT = txt
End function
%>
These are displayed through a file that reads the database.
At this time the display is text, URLs are not active.
The script is not so do not really know what to do.
I need that URLs appear as a link at this time does not happen.
Can you help me?
<%
IdMensaje = Request.QueryString("IdMensaje")
busca = Trim(Request.QueryString("busca"))
Set oConn = Server.CreateObject ("ADODB.Connection")
Set RS = Server.CreateObject ("ADODB.RecordSet")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&Server.MapPath(".private//usuarios.mdb")
sql = "SELECT * FROM discusion WHERE IdMensaje="&IdMensaje&""
Rs.Open sql, oConn, 1, 1
mensaje = RS("mensaje")
%>
<img src="anadir.gif" width="16" height="16"> <A HREF="contestar.asp?idmensaje=<%=IdMensaje%>"><B>Contestar
este mensaje</B></A><BR>
<BR>
<%'=== Muestro el mensaje padre. La pregunta inicial ======
Response.Write "<B>Nombre: </B>"&RS("name")&"<BR>"
Response.Write "<B>Email: </B>"&RS("mail")&"<BR>"
Response.Write "<B>Título del mensaje: </B>"&RS("Title")&"<BR>"
Response.Write "<B>Mensaje: </B><BR><P><I>"& AcomodarTXT(mensaje)&"</I></P>"
Response.Write "<HR WIDTH=""80%"">"
'===== Fin pregunta inicial ===== Set RS2 = Server.CreateObject ("ADODB.RecordSet")
sql2 = "SELECT * FROM discusion WHERE IdCabeza="&IdMensaje &" ORDER BY fecha"
RS2.Open sql2, oConn, 1, 1
'===== Respuestas a la pregunta inicial
Do While not RS2.EOF
mensaje2 = RS2("mensaje")
Response.Write "<BR><B>Nombre: </B>"&RS2("name")&"<BR>"
Response.Write "<B>Email: </B>"&RS2("mail")&"<BR>"
Response.Write "<B>Título del mensaje: </B>"&RS2("title")&"<BR>"
Response.Write "<B>Mensaje: </B><BR>"%><P><I><%= AcomodarTXT(mensaje2)%></I></P><BR>
<%
Response.Write "<HR WIDTH=""80%"">"
RS2.MoveNext
Loop
'===== Fin de respuestas ======
RS2.Close
Set RS2 = nothing
RS.Close
oConn.Close
Set RS = nothing
Set oConn = nothing
Function AcomodarTXT(txt)
txt = Replace (txt, "<", "<")
txt = Replace (txt, ">", ">")
txt = Replace (txt, vbCrLf, "<BR>")
txt = Replace (txt, "''", "'")
acomodarTXT = txt
End function
%>
•
•
Join Date: Oct 2006
Posts: 93
Reputation:
Solved Threads: 0
0
#3 11 Days Ago
I need to change the funcion AcomodarTXT(mensaje2) >"& AcomodarTXT(mensaje)&"
This function dont'convert url on active links, it is plan text
But I don't know how I change it?
Response.Write "<B>Mensaje: </B><BR>"%><P><I><%= AcomodarTXT(mensaje2)%></I></P><BR>
<%
Response.Write "<HR WIDTH=""80%"">"
RS2.MoveNext
Loop
'===== Fin de respuestas ======
RS2.Close
Set RS2 = nothing
RS.Close
oConn.Close
Set RS = nothing
Set oConn = nothing
Function AcomodarTXT(txt)
txt = Replace (txt, "<", "<")
txt = Replace (txt, ">", ">")
txt = Replace (txt, vbCrLf, "<BR>")
txt = Replace (txt, "''", "'")
acomodarTXT = txt
End function
This function dont'convert url on active links, it is plan text
But I don't know how I change it?
Response.Write "<B>Mensaje: </B><BR>"%><P><I><%= AcomodarTXT(mensaje2)%></I></P><BR>
<%
Response.Write "<HR WIDTH=""80%"">"
RS2.MoveNext
Loop
'===== Fin de respuestas ======
RS2.Close
Set RS2 = nothing
RS.Close
oConn.Close
Set RS = nothing
Set oConn = nothing
Function AcomodarTXT(txt)
txt = Replace (txt, "<", "<")
txt = Replace (txt, ">", ">")
txt = Replace (txt, vbCrLf, "<BR>")
txt = Replace (txt, "''", "'")
acomodarTXT = txt
End function
Last edited by Jhon100; 11 Days Ago at 4:21 am.
![]() |
Similar Threads
- Using Hidden Variables in ASP.NET (ASP.NET)
- Java Script with ASP page (ASP)
- ASP.Net VB Page to update a users profile not updating. (MS SQL)
- ASP.NET Timer Button (ASP.NET)
- How to Embed CheckList Box on HTML Page using Java Script (HTML and CSS)
- Windows 2000 server not allowing ASP access. (ASP)
- Server side script in asp won't run on Netscape (ASP)
- ASP .NET database hit counter (ASP.NET)
Other Threads in the ASP Forum
- Previous Thread: how can i display the ms word document in asp page?
- Next Thread: ASP Connection String
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





