
11/05/2003, 18:07
|
| | Fecha de Ingreso: mayo-2003
Mensajes: 101
Antigüedad: 22 años Puntos: 0 | |
Perdón me he explicado mal, la sentencia q me has dado antes si funciona sólo que subraya todo la frase como si fuera un enlace claro y yo lo q quería era separarlo, el código no es mío y yo no se mucho de esto... se que llama a una función de javascript y despues extrae una imagen de una base de datos...
Simplemente con separar los 2 campos me valdría pero no se como hacerlo... te copio el código de toda la página aunque bueno de lo q estamos tratando está casi al final... a ver si hay suerte y joer si eres de cerca de Asturias recuerdame q te invite a unas sidras... GRACIAS
<script language="javascript">
function abrir(imagen){
open("m_dcho.asp?casa="+imagen,"Casa","menubar=0,w idth=550,height=640,top=10,left=300,scrollbars=yes ")
}
</script>
</head>
<body onload="esconde();">
<script language="JavaScript">
if(ie || ns) document.write('<div id="precarga" align="center"><br>Esperen por favor...</div>');
</script>
<STYLE type="text/css">
<!--
A:link {COLOR:#6699cc; TEXT-DECORATION: none}
A:visited {COLOR:#6699cc; TEXT-DECORATION: none}
A:active {TEXT-DECORATION: none}
A:hover {COLOR:#336699 ; TEXT-DECORATION: underline} -->
</STYLE>
<%
On Error Resume Next
' Constants
const adOpenForwardOnly = 0 ' Forward only movement through records
const adOpenKeyset = 1 ' Movement any direction
const adOpenDynamic = 2
const adOpenStatic = 3
const adLockOptimistic = 3
' CheckError: Checks for, and reports Errors.
' Returns True if an error has occured, False otherwise
Function CheckError()
if Err.number <> 0 then
Response.Write "<p><FONT color=red><I>A run-time error occurred.<BR>Error Number: " &_
Err.number & "<BR>Error Description: " & Err.description & "</Font></I>"
CheckError = True
Else
CheckError = False
End If
end Function
' OpenDatabase: Opens a database connection
' IN:
' - DatabaseVirtualFilename: Virtual path to database file (.mdb)
' - Username: Username
' - Password: Password
' OUT:
' - Connection: The database connection
' RETURNS:
' - True if successful, False otherwise
Function OpenDatabase(DatabaseVirtualFilename, Username, Password, byref Connection)
' Initialise
OpenDatabase = False
Dim DatabaseFilename
DatabaseFilename = Server.MapPath(DatabaseVirtualFilename)
Dim ConnectionString
ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" &_
"DBQ=" & DatabaseFilename & ";DefaultDir=;" &_
"UID=" & Username & ";" &_
"PWD=" & Password & ";"
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.ConnectionTimeout = 30
Connection.CommandTimeout = 80
Connection.Open ConnectionString
OpenDatabase = True
end Function
Sub Lista(Connection)
Dim SQL
localidad=Request("loc")
SQL = "SELECT * FROM tabla WHERE localidad='" & localidad & "' OR provincia='" & localidad & "' ORDER BY numero"
' Create a RecordSet
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open SQL, Connection, adOpenForwardOnly, adLockOptimistic
if rs.EOF or rs.BOF Then
Response.Write "<p align=center>No hay grupos para mostrar" & vbCRLF
rs.Close
set rs = nothing
Exit sub
end if
Response.Write "<table width='80%' border='0' align='center'>" & vbCRLF
Response.write "<TR><TD><b>" & UCase(Request("loc")) & "</b><hr noshade></TD></TR>"
'Response.write "<form name='formulario'><select name='seleccion' onchange='abrir(this)'>"
While NOT rs.EOF
Response.write "<tr><td><a href='#' onclick=abrir('"& rs(1) & "')>" & rs(2) & "<b> Localidad </b>" & rs(4) & "</a></td></tr>"
'Response.write "<option value='" & rs(1) &"'>" & rs(2) & "</option>"
rs.MoveNext
Wend
Response.Write "</select></form></table>" & vbCRLF
rs.Close
set rs = nothing
End Sub
%>
<br>
<%
' Principal
Dim Connection
Dim SQL
if (OpenDatabase("casa.mdb","","",Connection)) Then
Lista Connection
End if
Connection.Close
set Connection = nothing
CheckError
%>
</body>
</html> |