ASP - mostrar datos de consulta

 
Vista:

mostrar datos de consulta

Publicado por Rodrigo (17 intervenciones) el 30/04/2007 22:48:37
tengo un problema al mostrar datos en una consulta, en una pagina busco el nombre y al momento de ir a buscar a la otra pagina no me muestra nada, aqui les muestro el codigo donde tienen que mostrar los datos

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/con_bienestar.asp" -->
<%
Dim resul_nom__MMColParam
resul_nom__MMColParam = "1"
If (Request.Form("nombre_socio") <> "") Then
resul_nom__MMColParam = Request.Form("nombre_socio")
End If
%>
<%
Dim resul_nom
Dim resul_nom_numRows

Set resul_nom = Server.CreateObject("ADODB.Recordset")
resul_nom.ActiveConnection = MM_con_bienestar_STRING
resul_nom.Source = "SELECT * FROM dbo.Socios WHERE nombre_socio = '" + Replace(resul_nom__MMColParam, "'", "''") + "'"
resul_nom.CursorType = 0
resul_nom.CursorLocation = 2
resul_nom.LockType = 1
resul_nom.Open()

resul_nom_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
resul_nom_numRows = resul_nom_numRows + Repeat1__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>

<body>
 
<div align="center">
<p>
<%
if (resul_nom_total)= "0" then %>
</script language="JavaScript" type="text/javascript">
</script>
<br />
</p>
<p>
<script language="JavaScript" type="text/javascript">{ alert("El Nombre ingresado no existe en la base de datos.")
}

</script>
<a href="ingreso_socio2.asp">Ingresar Socio</a> </p>
<p><a href="bus_nombres.asp">Volver a buscar</a> </p>
<p>
<%


else%>
</p>
</div>
<table border="1" align="center">
<tr>
<td><div align="center">nombre_socio</div></td>
<td><div align="center">Rut</div></td>
<td><div align="center">ap_paterno</div></td>
<td><div align="center">ap_materno</div></td>
<td><div align="center">tel_laboral</div></td>
<td><div align="center">area</div></td>
<td> </td>
<td> </td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT resul_nom.EOF)) %>
<tr>
<td><%=(resul_nom.Fields.Item("nombre_socio").Value)%></td>
<td><%=(resul_nom.Fields.Item("Rut").Value)%></td>
<td><%=(resul_nom.Fields.Item("ap_paterno").Value)%></td>
<td><%=(resul_nom.Fields.Item("ap_materno").Value)%></td>
<td><%=(resul_nom.Fields.Item("tel_laboral").Value)%></td>
<td><%=(resul_nom.Fields.Item("area").Value)%></td>
<td><A HREF="ver_detalle_socio.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "Id_Socios=" & resul_nom.Fields.Item("Id_Socios").Value %>">ver detalle</A> </td>
<td>eliminar</td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
resul_nom.MoveNext()
Wend
%>
</table>
<p>
<%end if%>
</p>
</body>
</html>
<%
resul_nom.Close()
Set resul_nom = Nothing
%>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder