Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/06/2008, 11:46
haga41
 
Fecha de Ingreso: junio-2008
Mensajes: 145
Antigüedad: 16 años, 10 meses
Puntos: 0
Problemas de acentos y ñ al acceder desde ASP a bases de datos Access.

Buenas tardes a todos,

Estoy liado con un archivo asp que tiene acceso a bases de datos de Access y en los acentos y las ñ saca caracteres extraños.

He revisado la codificación de la página asp y me parece correcta ya que el iso es 8859-1 que creo que es el debería de mostrar estos caracteres. La base de datos de Access tiene los campos de tipo texto con la compresión unicode activada, he probado también con campos tipo memo porque me interesaba meter más texto y también se ve mal. Si escribo en los textos los acentos y eñes con &acute &ntilde si se muestran correctamente, pero de momento no he encontrado ninguna forma mejor de hacerlo. ¿Alguna idea de como solucionar el problema?

Este es el código de la página ASP:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!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" xml:lang="es" lang="es">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Documento sin t&iacute;tulo</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<link rel="stylesheet" type="text/css" href="../Templates/estilorevistamotos2.css">
<!--#include file="../includes/AbrirBd.asp"-->
</head>

<body>
<center>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#FFFFFF" colspan="3" valign="top"><img src="../imagenes/cabeceramotos.jpg" alt="cab_moto" width="775" height="121" /></td>
</tr>
<tr class="rojo">
<td id="izquierda"><%=time()%></td>
<td class="derecha"><%=date()%></td>
</tr>

<tr>
<td colspan="2"><table width="70%" height="70" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="178" align="center" valign="top" class="contentarea">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#9DACBF" class="contentarea">
<tr>
<td class="negro1"><a href="../index.asp">Inicio</a></td>
</tr>
<tr>
<td class="negro1" ><a href="../noticias.asp">Noticias</a></td>
</tr>
<tr>
<td class="negro1" ><a href="../pruebas.asp">Pruebas</a></td>
</tr>
<tr>
<td class="negro1" ><a href="../contacto.asp">Contacto</a></td>
</tr>
<tr>
<td class="negro1" ><a href="../comparativa.asp">Comparativa</a></td>
</tr>
<tr>
<td class="negro1" ><a href="../links.asp">Links</a></td>
</tr>
<tr>
<td class="negro1" ><a href="../zonausuarios.asp">Zona de usuarios</a></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<a href="http://www.dainese.com/esp/home.asp" target="_blank"><img src="../imagenes/banner.gif" alt="dainese" width="177" height="193" border="0"/></a> </td>
</tr>
</table>
<!--tabla 2--></td>
<td width="420" align="center" valign="top" class="contentarea">
<!-- TemplateBeginEditable name="Editable" -->
<table width="420" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" height="14px" class="centro2">
NOTICIAS</td>
</tr>
<tr>
<td height="590" valign="top" class="izquierda" background="imagenes/fndnoticias.jpg">
<% sql = "Select * from NOTICIAS order by fecha desc"
tabla.open sql,conexion%>
<ol>
<%while not tabla.eof%>
<%idp = tabla.fields("id")%>
<li><a class="menupruebas" href="noticia_detalle.asp?idp=<%=idp%>"><%=tabla.f ields("titular")%>. <b><%=tabla.fields("fecha")%></a></b></li>
<% tabla.movenext()
wend
tabla.close
%>
</ol>
</td>
</tr>
</table>
<!-- TemplateEndEditable -->
</td>
<td width="178" align="center" valign="top" class="contentarea"><table cellpadding="0" cellspacing="0">
<tr>
<td align="center" class="negro1">Buscador</td>
</tr>
<tr>
<td colspan="2" align="center" class="negro1"><form action="../resultados.asp" method="post" name="form1" class="centro2" id="form1">
<input name="buscar" type="text" size="30" maxlength="30"/>
</br>
<input name="buscador" type="radio" value="1" checked="checked"/>
Noticias</br>
<input name="buscador" type="radio" value="2" />
Pruebas</br>
<input type="submit" name="btbuscar" id="btbuscar" value="Buscar" />

</form></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<a href="http://www.alpinestars.com" target="_blank"><img src="../imagenes/banner2_ex.gif" alt="alpinestars" width="187" height="188" border="0"/></a> </td>
</tr>

</table></td>
</tr>
</table>
<!--fin de la tabla 2--> </td>
</tr>
<tr>
<td colspan="3" class="centro">&nbsp;</td>
</tr>
</table>
</center>
</body>
</html>


Y este el archivo include que llama a la base de datos:


<%
Set conexion = Server.CreateObject("ADODB.Connection")
Set tabla = Server.CreateObject("ADODB.recordset")
Set tabla2 = Server.CreateObject("ADODB.recordset")
conexion.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0; Data Source="&server.MapPath("MOTOS.mdb")
%>

Agradecería mucho cualquier ayuda.