Foros del Web » Programando para Internet » ASP Clásico »

[SOLUCIONADO] directorio busquedas con acentos

Estas en el tema de directorio busquedas con acentos en el foro de ASP Clásico en Foros del Web. Hola buen dia he creado un directorio la base de datos esta en sql server y el directorio lo hice mediante unos asp. este es ...
  #1 (permalink)  
Antiguo 22/08/2012, 08:07
 
Fecha de Ingreso: mayo-2012
Mensajes: 18
Antigüedad: 11 años, 11 meses
Puntos: 0
directorio busquedas con acentos

Hola buen dia
he creado un directorio la base de datos esta en sql server y el directorio lo hice mediante unos asp.

este es mi index

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Directorio - Buscame</title>
<style type="text/css">
<!--
body {
background-color: #ededed;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
}
.Estilo2 {font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;}
-->
</style></head>

<body onLoad="document.form1.nombre.focus();">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="10" CELLPADDING="5" BGCOLOR="#FFFFFF">
<TR>
<TD><IMG SRC="media/logo1.gif" WIDTH="178" HEIGHT="68"></TD>
<TD><IMG SRC="media/spacer.gif" WIDTH="20" HEIGHT="20"></TD>
<TD WIDTH="100%"><DIV ALIGN="RIGHT"><IMG SRC="media/logo2.gif" WIDTH="169" HEIGHT="58"></DIV></TD>
</TR>
</TABLE>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#666666">
<TR>
<TD WIDTH="100%"><IMG SRC="media/spacer2.gif" WIDTH="20" HEIGHT="5"></TD>
</TR>
</TABLE>
<p>&nbsp;</p>
<form id="form1" name="form1" method="post" action="buscador2.asp">
<blockquote>
<p align="left"><strong>Nombre:<span class="Estilo2">&nbsp; </span></strong>
<input name="nombre" type="text" id="nombre" />
<IMG SRC="media/spacer.gif" WIDTH="20" HEIGHT="20">
<input type="submit" name="Submit" value="Buscar " />
</p>
</blockquote>
</form>
<form id="form1" name="form1" method="post" action="buscador3.asp">
<blockquote>
<p align="left"><strong>Puesto:&nbsp;</strong><span class="style1">&nbsp; </span>
<input name="nombre" type="text" id="nombre" />
<IMG SRC="media/spacer.gif" WIDTH="20" HEIGHT="20">
<input type="submit" name="Submit" value="Buscar " />
</p>
</blockquote>
</form>

</body>
</html>



y mi buscador que esta en asp



<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/conexion.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("nombre") <> "") Then
Recordset1__MMColParam = Request.Form("nombre")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conexion_STRING
Recordset1.Source = "SELECT Nombre, Puesto, Area, Extension, Email FROM buscame_directorio WHERE Nombre LIKE '%" + Recordset1__MMColParam + "%'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!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>Directorio - Buscame</title>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es requerido.\n'; }
} if (errors) alert('error:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<style type="text/css">
<!--
body {
background-color: #ededed;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style2 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; }
.style3 {font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;}
a:link {
color: #FF0000;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
color: #FF0000;
}
a:hover {
text-decoration: none;
color: #FF0000;
}
a:active {
text-decoration: underline;
color: #FF0000;
}
-->
</style></head>

<body onLoad="document.form1.nombre.focus();">
<table width="100%" border="0" cellspacing="10" cellpadding="5" bgcolor="#FFFFFF">
<tr>
<td><img src="media/logo1.gif" width="178" height="68" /></td>
<td><img src="media/spacer.gif" width="20" height="20" /></td>
<td width="100%"><div align="right"><img src="media/logo2.gif" width="169" height="58" /></div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#666666">
<tr>
<td width="100%"><img src="media/spacer2.gif" width="20" height="5" /></td>
</tr>
</table>
<p>&nbsp;</p>

<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<table width="101%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#999999" bgcolor="#FFFFFF">
<tr>
<td width="22%" bgcolor="#CCCCCC"> <div align="center">Nombre
</div></td>
<td width="19%" bgcolor="#CCCCCC"> <div align="center">&Aacute;rea </div></td>
<td width="24%" bgcolor="#CCCCCC"><center class="style2">
<p class="style2">Puesto</p>
</center></td>
<td width="22%" bgcolor="#CCCCCC"><div align="center">Extensi&oacute;n</div>
<center spry:hover="style2" class="style2">
</center> </td>
<td width="13%" bgcolor="#CCCCCC"> <div align="center">Email
</div>
<center spry:hover="style2" class="style2">
</center> </td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td class="style3"><%=(Recordset1.Fields.Item("Nombre" ).Value)%></td>
<td class="style3"><%=(Recordset1.Fields.Item("Area"). Value)%></td>
<td class="style3"><%=(Recordset1.Fields.Item("Puesto" ).Value)%></td>
<td class="style3"><%=(Recordset1.Fields.Item("Extensi on").Value)%></td>
<td><a href="mailto:<%=(Recordset1.Fields.Item("Email").V alue)%>"><%=(Recordset1.Fields.Item("Email").Value )%></a></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<p>&nbsp;</p>
<form action="buscador2.asp" method="post" name="form1" id="form1" onsubmit="MM_validateForm('nombre','','R');return document.MM_returnValue">
<blockquote>
<p align="left"><span class="style1"><strong>Nombre:&nbsp;</strong></span>
<input name="nombre" type="text" id="nombre" />
<img src="media/spacer.gif" width="20" height="20" />
<input type="submit" name="Submit" value="Buscar" />
</p>
</blockquote>
</form>
<form action="buscador3.asp" method="post" name="form1" id="form1" onsubmit="MM_validateForm('nombre','','R');return document.MM_returnValue">
<blockquote>
<p align="left"> <strong>Puesto</strong>:&nbsp;&nbsp;<span class="style1">&nbsp; </span>
<input name="nombre" type="text" id="nombre" />
<img src="media/spacer.gif" width="20" height="20" />
<input type="submit" name="Submit" value="Buscar" />
</p>
</blockquote>
</form>
<% Else %>
Lo sentimos, no hay resultados


<a href=index.htm>
<P align="center">Regresar</P>
</a>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>


como se daran cuenta lo meti en unos recordsert los resultados, el problema aqui es que si busco uno nombre como jose no me aparecen los josè que vienen acentuados saben de alguna solucion en la base de datos los nombres vienen con acentos.


Gracias

Última edición por alberto_audi; 23/08/2012 a las 07:47

Etiquetas: acentos, asp, busquedas, directorio, server
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:03.