<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">

<channel>
<title>Blog bloc</title>
<link>http://widea.zoomblog.com/</link>
<description>Blog sobre programaci&#243;n y dise&#241;o web de un programador en Sevilla</description>
<dc:language>es</dc:language>
<dc:date>2006-04-08T12:03:00+01:00</dc:date>
<lastBuildDate>Wed, 14 May 2008 08:41:43 GMT</lastBuildDate>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<image>
<title>ZoomBlog</title>
<url>http://www.zoomblog.com/pics/blogs/ZoomBlog_mini.gif</url>
<link>http://www.zoomblog.com/</link>
</image>

<item>
 <title>Object Literal y los nombres de espacio en javascript</title>
<link>http://widea.zoomblog.com/archivo/2006/04/08/object-Literal-y-los-nombres-de-espaci.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2006/04/08/object-Literal-y-los-nombres-de-espaci.html</guid>
 <description>
 <![CDATA[
C&#243;mo todo el mundo sabe, javscript puede ser un lenguaje muy feo y s&#243;lo algunos hab&#237;an conseguido exprimir la quintaesencia de este lenguaje, como se hac&#237;a en dhtmlcentral.com, cuyas librer&#237;as han sido toda una ayuda para los que programamos en javascript desde hace a&#241;os.<br />No obstante, eso fue una etapa y los tiempos cambian, y se han buscado nuevas formas que nos acerquen al tipo de lenguaje orientado a objeto propiamente dicho como es java o m&#225;s actual, .net.<br />Siempre se ha pensado que era imposible crear clases en javascript, y es as&#237;,jaja, pero han buscado formas de imitarlo mediante la creaci&#243;n de objetos, lo que se ha venido a llamar en el mundo angl&#243;fono, <b>namespaced javascript</b> o <b>object Literal</b>.<br />Antes de entrar en materia, os har&#233; un resumen de lo que estoy diciendo para que nos entendamos.<br /><br /><strong>ANTES:</strong><br />Antes todo eran funciones y entonces siempre pod&#237;a pasar que si inclu&#237;amos 2 archivos de javascript distintos pudieran compartir nombres de funciones similares, y al m&#225;s frecuentes, variables globales similares, y por lo tanto, ambos scripts dejaban de funcionar.<br />Como mencionaba, en dhtmlcentral.com y en otros sitios, propulsaron una forma propia de javascript de crear pseudo-classes, se hac&#237;a as&#237;:<br /><span style="color: rgb(0, 153, 0);">function bola()</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">{</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">this.moverx=moverx;</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">this.movery=movery;</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">}</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">function moverx()</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">{</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">}</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">function movery()</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">{</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">}</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">nuevaBola=new bola();</span><br /><br /><br />O sea cre&#225;bamos un objeto, que ten&#237;a asociado unos pseudo-m&#233;todos, pero el problema de que otro script tuviera una funci&#243;n con el mismo nombre segu&#237;a ah&#237;.Hab&#237;a que fastidiarse.<br /><strong>AHORA:</strong><br />Hoy d&#237;a, con el surgimiento de Ajax se le est&#225; dando mucho bombo a otra forma de imitar las clases, y no es algo nuevo, pero lo cierto es que es cada vez m&#225;s frecuente. <br />La "nueva forma", el javascript con nombre de espacio, no crea clases, crea objetos a los que se les a&#241;ade propiedades, que van a hacer las veces de variables locales por su puesto p&#250;blicas (aqu&#237; no hay distinciones del tipo privada o protegida) y m&#233;todos, m&#233;todos que no van a poder pisarse por otros scripts, aunque por supuesto nada de m&#233;todos con la propiedad <i>override</i> ni <i>sealed</i> ni nada que se le parezca. Es un truco, no una soluci&#243;n final.<br />Si has llegado hasta aqu&#237;, y no sabes de que estoy hablando, este ejemplo te har&#233; comprender:<br /><span style="color: rgb(0, 153, 0);">myscript=new Object();</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">myscript.current=1;</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">myscript.init=function(){</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp; // some code</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">}</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">myscript.validate=function(){</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp; // some code</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">}</span><br /><br />Otro ejemplo con el c&#243;digo m&#225;s resumido, no voy a decir m&#225;s elegante, pero mejor para tener todo en un s&#243;lo bloque:<br /><span style="color: rgb(0, 153, 0);">myscript={</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp; current:1,</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp; init:function(){</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; // code</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp; },</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp; validate:function(){</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; // code </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;}</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">}</span><br />Por lo tanto, os animo aquello que hay&#225;is tenido la suerte o la desgracia de llegar hasta aqu&#237; que para cuando teng&#225;is tiempo en el trabajo de programar bien javascript y sea un proyecto algo complejo o reutilizable, coj&#225;is las riendas de los nombres de espacio en javascript y empec&#233;is a crear objetos.
 ]]>
</description>
 <dc:date>2006-04-08T12:03:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

<item>
 <title>Dolor de cabeza: redondeando en ASP</title>
<link>http://widea.zoomblog.com/archivo/2006/04/05/dolor-de-cabeza-redondeando-en-Asp.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2006/04/05/dolor-de-cabeza-redondeando-en-Asp.html</guid>
 <description>
 <![CDATA[
Aquellos que hay&#225;is programado en cualquier lenguaje medianamente aceptable,<br />habr&#225; podido apreciar que las funciones matem&#225;ticas math.floor y math.ceil o <br />math.ceiling nos proporcionan m&#233;todos para redondear hacia abajo o hacia <br />arriba, cosa que para algunos casos es vital.<br />Pues bien, ASP ni lo huele. <br />No obstante, siempre podemos crearnos unos m&#233;todos ingeniosos para conseguir casi los mismos<br />resultados.<br /><br />He creado 2 funciones que podemos llamar seg&#250;n queramos redondear hacia arriba<br />o hacia abajo, llamadas roundDown y roundUp, y despu&#233;s una funci&#243;n con piloto<br />autom&#225;tico y que decidir&#225; si usar uno u otro m&#233;todo dependiendo de su decimal:<br />autoRound.<br /><br />La gran pregunta aqu&#237; es qu&#233; pasa si le paso 10,5, pues seg&#250;n ocurre por ejemplo en<br />.NET se redondea hacia abajo, pero si est&#225; por encima, p.e., 10,51 se redondea hacia<br />arriba. <br />En un principio me plantee que examinar&#237;a el 2 decimal y si &#233;ste era mayor de 0 redondear&#237;a<br />hacia arriba, pero que pasa si el n&#250;mero fuera 10,501. Con este m&#233;todo hubiera<br />redondeado hacia abajo, y shlaf!! gran error, gran horror.<br />Es por eso que en autoRound empleo un loop que me indicar&#225; si uno de los decimales<br />a partir del segundo decimal es mayor de 0 pues se redondear&#225; hacia arriba.<br /><br />Esta funci&#243;n tambi&#233;n lo toma en cuenta:<br /><br /><br /><span style="color: rgb(0, 153, 0);">Function roundDown(dblValue)</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Dim myDec</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">myDec = InStr(1, CStr(dblValue), ",")</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">If myDec &gt; 0 Then</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; roundDown = CDbl(Left(CStr(dblValue), myDec))</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Else</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; roundDown = dblValue</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">End If</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">End Function</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Function roundUp(dblValue)</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Dim myDec</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">myDec = InStr(1, CStr(dblValue), ",")</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">If myDec &gt; 0 Then</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; roundUp = CDbl(Left(CStr(dblValue), myDec)) + 1</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Else</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; roundUp = dblValue</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">End If</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">End Function</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">function autoRound(dblValue)</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Dim myDec,pos,ini,aux</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">ini=1</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">pos = InStr(1, CStr(dblValue), ",")</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">myDec=left(mid(cstr(dblValue),pos+ini),1)</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">aux=false</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">If myDec &gt; 5 Then</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; autoRound = roundUp(dblValue)</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; Else</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; if myDec = 5 then&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; do while Len(myDec)&gt;0 and aux=false and ini&lt;100</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ini=ini+1</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myDec=left(mid(cstr(dblValue),pos+ini),1)&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if not isNumeric(myDec) then myDec=0&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if myDec&gt;0 then&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;aux=true</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end if</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; loop</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if aux=true then</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;autoRound = roundUp(dblValue)</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; autoRound = roundDown(dblValue)</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end if</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; else</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; autoRound = roundDown(dblValue)</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; end if</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">end if</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">end function</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "&lt;br&gt;"</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,66: " &amp; autoRound("10,66") &amp; "&lt;br&gt;"'El output ser&#225; 11.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,1: " &amp;autoRound("10,1") &amp; "&lt;br&gt;"'El output ser&#225; 10.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,55: " &amp;autoRound("10,55") &amp; "&lt;br&gt;"'El output ser&#225; 11.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,5555: " &amp;autoRound("10,5555") &amp; "&lt;br&gt;"'El output ser&#225; 11.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,5: " &amp;autoRound("10,5") &amp; "&lt;br&gt;"'El output ser&#225; 10.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,51: " &amp;autoRound("10,51") &amp; "&lt;br&gt;"'El output ser&#225; 10.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,501: " &amp;autoRound("10,501") &amp; " Este estar&#237;a mal si no hici&#233;ramos el loop&lt;br&gt;"'El output ser&#225; 10.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,5001: " &amp;autoRound("10,5001") &amp; " Este estar&#237;a mal si no hici&#233;ramos el loop&lt;br&gt;"'El output ser&#225; 10.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10,5000: " &amp;autoRound("10,5000") &amp; " Este estar&#237;a mal si no hici&#233;ramos el loop&lt;br&gt;"'El output ser&#225; 10.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write "10: " &amp;autoRound("10") &amp; "&lt;br&gt;"'El output ser&#225; 10.</span><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">&nbsp;</span>
 ]]>
</description>
 <dc:date>2006-04-05T14:25:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

<item>
 <title>Dejadme salir!!!</title>
<link>http://widea.zoomblog.com/archivo/2006/04/05/dejadme-salir.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2006/04/05/dejadme-salir.html</guid>
 <description>
 <![CDATA[
Para los que proced&#225;is de PHP como yo mismo, le habr&#233;is dado algunas vueltas antes de encontrar el equivalente a <span style="color: rgb(0, 153, 0);">Exit </span>en ASP. <br />C&#243;mo que no funciona la famosa etiqueta? Cu&#225;l ser&#225; la soluci&#243;n? Antes de que empecemos a sudar, la soluci&#243;n es simplemente:<br /><span style="color: rgb(0, 153, 0);">Response.End</span>
 ]]>
</description>
 <dc:date>2006-04-05T13:06:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

<item>
 <title>Utilizar chr en lugar de caracteres</title>
<link>http://widea.zoomblog.com/archivo/2006/04/05/utilizar-chr-en-lugar-de-caracteres.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2006/04/05/utilizar-chr-en-lugar-de-caracteres.html</guid>
 <description>
 <![CDATA[
Como regla general, recomiendo utilizar chr para las sustituciones de tipo replace para<br />los caracteres especiales, por ejemplo, si quiero sustituir unas comillas,<br />pensemos en el siguiente c&#243;digo:<br /><br /><span style="color: rgb(0, 153, 0);">dim strPrueba</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">strPrueba="texto ""de prueba"""</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">strPrueba=replace(strPrueba,"""","")</span><br /><br />No queda claro porque hay un barullo de dobles comillas propio de un lenguaje<br />como asp.<br /><br />En su lugar yo utilizar&#237;a algo m&#225;s elegante:<br /><span style="color: rgb(0, 153, 0);">strPrueba=replace(strPrueba,chr(34),"")</span><br /><br />Podemos buscarle utilidades interesantes al m&#233;todo chr, el m&#225;s &#250;til dir&#237;a yo que es<br />el car&#225;cter que indica retorno de carro.<br />Esto es &#250;til cuando el texto ha sido insertado desde un textarea. Se trata del car&#225;cter 13, el 13 es tu n&#250;mero como<br />dicen en las pelis americanas. <br />Con el siguiente source podr&#225;s convertir esos caracteres a saltos de html.<br /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">textArticle= replace(strPrueba, chr(13),"&lt;br&gt;")</span><br /><br />Otra utilidad muy interesante es sustituir barras inclinadas hacia un lado por otras hacia el otro lado.<br /><br />Otro truco al respecto, pod&#233;is saber a qu&#233; corresponde cada caracter as&#237;:<br /><br /><span style="color: rgb(0, 153, 0);">for i=0 to numMax step 1 </span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">Response.Write (i &amp; ":" &amp; chr(i) &amp; "&lt;br&gt;")</span><br style="color: rgb(0, 153, 0);" /><br style="color: rgb(0, 153, 0);" /><span style="color: rgb(0, 153, 0);">next</span><br /><br />
 ]]>
</description>
 <dc:date>2006-04-05T12:58:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

<item>
 <title>Funci&#243;n/m&#233;todo para combatir el SQL INJECTION</title>
<link>http://widea.zoomblog.com/archivo/2006/03/23/funcionmetodo-para-combatir-el-Sql-Inj.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2006/03/23/funcionmetodo-para-combatir-el-Sql-Inj.html</guid>
 <description>
 <![CDATA[
<p>Como no pod&#237;a faltar, os presento aqu&#237; una funci&#243;n que os ser&#225; util&#237;sima para aquellos que pas&#225;is de procedimientos almacenados o que no os viene bien o no pod&#233;is o... bueno, paro ah&#237;.</p>
<p>Se trata de una funci&#243;n o m&#233;todo para combartir el SQL INJECTION. Como todos sab&#233;is, es un ataque a trav&#233;s de la barra de navegaci&#243;n o a trav&#233;s de cajas de texto en vuestra web etc... en el que se inyectan c&#243;digos malignos tipo DELETE etc... para da&#241;ar vuestra web o simplemente para acceder a sitios restringidos.</p>
<p>Bueno sin enrollarme m&#225;s y agradeciendo la refinaci&#243;n de la funci&#243;n a mi compa&#241;ero Andr&#233;s os dejo aqu&#237; esta funci&#243;n que deber&#237;ais incluir&nbsp;en vuestra librer&#237;a de utilidades:</p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">Function AntiSqlInjection(cadena)
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">dim charReplace, valuesBanned, x
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">'constantes de caracteres a eliminar
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">Const CHARS = "'&#37;/\&lt;&gt;()"
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" color="#009900" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
<p>&nbsp;</p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">For x = 1 To Len(CHARS) 
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; charReplace = MID(CHARS, x, 1) 
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cadena = Replace(cadena, charReplace, " ") 
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">Next 
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" color="#009900" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
<p>&nbsp;</p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">'no queremos estos valores prohibidos
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">valuesBanned=Array("select","delete","update","insert", "truncate", "drop", "--")
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">for each valuesBanned in valuesBanned
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cadena=Replace(lcase(cadena),valuesBanned,"")
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">next
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">AntiSqlInjection=cadena
<p></p></font></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><font color="#009900">End Function
<p></p></font></span></font></p>
 ]]>
</description>
 <dc:date>2006-03-23T11:08:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

<item>
 <title>Ajax y su ayudante Sarissa</title>
<link>http://widea.zoomblog.com/archivo/2005/09/19/ajax-y-su-ayudante-Sarissa.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2005/09/19/ajax-y-su-ayudante-Sarissa.html</guid>
 <description>
 <![CDATA[
<font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;">En mi art&#237;culo anterior os hablaba de <span style="font-weight: bold;">las prendas y virtudes de Ajax</span>, y me qued&#233; con la sensaci&#243;n de haberme quedado muy corto en mis explicaciones y en las implicaciones que conlleva este m&#233;todo (no lo llamar&#233; tecnolog&#237;a tal y como explica Jesse James Garrett en </span><a target="_blank" href="http://www.adaptivepath.com/publications/essays/archives/000385.php" style="font-family: verdana,arial,helvetica,sans-serif;">http://www.adaptivepath.com/publications/essays/archives/000385.php</a><span style="font-family: verdana,arial,helvetica,sans-serif;">.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">No obstante, ahora que ya tenemos m&#225;s o menos claro qu&#233; es Ajax, c&#243;mo se hace con javascript etc... Llega el <span style="font-weight: bold;">"momento API"!!!!!</span></span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">El momento API es el momento de perfeccionamiento de una t&#233;cnica o de cualquier tipo de programaci&#243;n. Es el momento en el que todo ese c&#243;digo diseminado, "scattered", forma un conjunto y se vuelve algo profesional.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Yo he optado por tomar prestado una API que hasta el momento ha atendido todas mis necesidades. Se trata de la API de Sarissa:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><a target="_blank" href="https://sourceforge.net/projects/sarissa/" style="font-family: verdana,arial,helvetica,sans-serif;">https://sourceforge.net/projects/sarissa/</a><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Es un proyecto "open source" con el que unificamos el uso de Ajax para diferentes navegadores, no s&#233; si Opera y otros, pero s&#237; para Mozilla e Internet Explorer, y KHTML(Konqueror y Safari).</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></font><font size="2" style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">APIs javascript</span></font><font size="1"><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Quien nunca haya utilizado una API de javascript, pensar&#225; una API de javascript? Ese lenguaje horrible que no puede </span><span style="font-family: verdana,arial,helvetica,sans-serif;">depurarse como los verdaderos lenguajes de programaci&#243;n?</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Eso no puede traer nada bueno!!</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Pues bien, se equivocan, por supuesto, javascript no es perfecto, pero conocer javascript para un programador web es </span><span style="font-family: verdana,arial,helvetica,sans-serif;">como el volante para un conductor, y sin javascript, no hay programador web. Suena obvio pero no es tanto as&#237;, porque </span><span style="font-family: verdana,arial,helvetica,sans-serif;">el programador web tiende a aferrarse al lenguaje de servidor y aunque en una gran empresa todo el trabajo est&#225; </span><span style="font-family: verdana,arial,helvetica,sans-serif;">dividido y seguramente no le toque escribir ni una l&#237;nea de javascript, para optimizar la navegaci&#243;n del usuario, </span><span style="font-family: verdana,arial,helvetica,sans-serif;">resulta necesario al 100&#37;.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Al igual que antes los locos del javascript debieron adaptarse a los descubrimientos m&#225;s &#243;ptimos de las CSS, ahora que </span><span style="font-family: verdana,arial,helvetica,sans-serif;">xmlhttpRequest est&#225; dando fuerte, a los programadores ya no les queda otra que aprender javascript o se quedar&#225;n </span><span style="font-family: verdana,arial,helvetica,sans-serif;">obsoletos. De hecho, todos los programadores tenemos que reintepretar la web y la forma de programar, y se debe </span><span style="font-family: verdana,arial,helvetica,sans-serif;">invertir un per&#237;odo en reflexi&#243;nar al respecto.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; text-decoration: underline;">Beneficios de una API:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">-Una API de javascript hace como cualquier otra API, centraliza el c&#243;digo, ahorra c&#243;digo y se edita con facilidad </span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">porque s&#243;lo hay que modificarlo una vez.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; text-decoration: underline;">Negativos de una API:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">-El c&#243;digo se vuelve m&#225;s dif&#237;cil, el programador tiene que aprender nuevos c&#243;digos y sin una buena documentaci&#243;n es de </span><span style="font-family: verdana,arial,helvetica,sans-serif;">dif&#237;cil modificaci&#243;n.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Tomando todo esto en cuenta, yo principalmente opto por las APIs de javascript pero no las totalizadoras, que hacen </span><span style="font-family: verdana,arial,helvetica,sans-serif;">todo lo que quieras en tu web, s&#243;lo en casos concretos, donde las diferencias de c&#243;digos entre navegadores se vuelve </span><span style="font-family: verdana,arial,helvetica,sans-serif;">m&#225;s dispar.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">El caso m&#225;s claro de una buen API es<span style="font-weight: bold;"> la maravillosa y famosa API de dhtmlcentral.com</span>. Es una API que me ha acompa&#241;ado </span><span style="font-family: verdana,arial,helvetica,sans-serif;">siempre y que he mejorado con el tiempo.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Qu&#233; conseguimos con una API si javascript hace unas tareas muy sencillas? Pues simplemente, unificamos el javascript </span><span style="font-family: verdana,arial,helvetica,sans-serif;">que utilizan todos los navegadores. Por ejemplo, para ocultar una capa se hace diferente en IE4 que en IE6, Mozilla o </span><span style="font-family: verdana,arial,helvetica,sans-serif;">Netscape 4.5. Con la API de dhtmlcentral escribimos una l&#237;nea y lo hace compatible para todos.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Esto mismo conseguimos con Sarissa, m&#225;s otras tareas relacionadas con el DOM.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><font size="2" style="font-weight: bold;"><span style="font-family: verdana,arial,helvetica,sans-serif;">Sarissa, la API para Ajax</span></font><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">En este tutorial, voy a tratar 2 m&#233;todos de cargar XML con Ajax.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Uno utilizando XmlhttpRequest y otro cargando XML con el objeto load, que en IE pertenece al ActiveX </span><span style="font-family: verdana,arial,helvetica,sans-serif;">Msxml2.DOMDocument, y que en Mozilla se implementa de otra manera.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">No obstante, como dec&#237;a m&#225;s arriba, no nos vamos a preocupar de las diferencias entre navegadores porque Sarissa har&#225; </span><span style="font-family: verdana,arial,helvetica,sans-serif;">los deberes por nosotros.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">El resultado con ambos m&#233;todos es el mismo. No obstante, xmlhttpRequest, nos ofrece un mejor control sobre el estado </span><span style="font-family: verdana,arial,helvetica,sans-serif;">de la carga del xml, porque podemos utilizar la propiedad ReadyState.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Como &#250;ltimo apunte, Sarissa no se implementa creando una clase Sarissa, sino que se llama de manera est&#225;tica.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Empecemos de lleno:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">1.-</span>Bajamos la API de su web.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">2.-</span>Incluimos los js:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;script language="javascript" src="sarissa.js"&gt;&lt;/script&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;script language="javascript" src="sarissa_ieemu_xpath.js"&gt;&lt;/script&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">3.-</span>Creamos el formulario que describ&#237;a en mi &#250;ltimo tutorial sobre Ajax, pero incluyendo un nuevo enlace que llama a </span><span style="font-family: verdana,arial,helvetica,sans-serif;">getDatosXML para cargar XML utilizando load:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;div id="lblError"&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;/div&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;form id="detalles" name="detalles" method="post"&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&lt;table cellpadding="0" cellspacing="0" border="0"&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td nowrap="nowrap" class="items" style="visibility:hidden"&gt;Metatags:&lt;/td&gt;&lt;td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;textarea cols="40" rows="1" name="metatags" id="metatags"&gt;&lt;/textarea&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td nowrap="nowrap" class="items" style="visibility:hidden"&gt;Descripci&#243;n:&lt;/td&gt;&lt;td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;textarea cols="40" rows="1" name="descripcion" id="descripcion"&gt;&lt;/textarea&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td nowrap="nowrap" class="items" style="visibility:hidden"&gt;Descripci&#243;n larga:&lt;/td&gt;&lt;td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;textarea cols="40" rows="1" name="descripcionlarga" id="descripcionlarga"&gt;&lt;/textarea&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/table&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;div class="buttons1"&gt;&lt;a href="javascript:getDatos()"&gt;Llenar&lt;/a&gt;&lt;/div&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;div class="buttons1"&gt;&lt;a href="javascript:getDatosXML()"&gt;LlenarXML&lt;/a&gt;&lt;/div&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;/form&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">4.-</span>Ahora incluyamos las funciones getDatos y getDatosXML:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">var xmlhttp=null;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">function getDatos(){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp; if(xmlhttp &amp;&amp; xmlhttp.readyState!=0 &amp;&amp; xmlhttp.readyState!=4){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; alert("espere mientras la conexi&#243;n anterior termina")</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; return;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">strUrl="xmlhttp_select.cs.asp?docid=4"</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmlhttp = new XMLHttpRequest();</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmlhttp.open("GET", strUrl, true);</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmlhttp.onreadystatechange=handlergetDatos</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmlhttp.send(null);</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">function getDatosXML(){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">strUrl="xmlhttp_select.cs.asp?docid=4"</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">respuestaXML= Sarissa.getDomDocument(); </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">respuestaXML.async = false; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">respuestaXML.load(strUrl); </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mostrarDatos(1)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Como vemos m&#225;s arriba, hemos reducido mucho el c&#243;digo, ya no tenemos ninguna funci&#243;n que se encarga de crear la </span><span style="font-family: verdana,arial,helvetica,sans-serif;">compatibilidad del objeto xmlhttpRequest. De esto se encarga Sarissa, que ha redefinido el objeto, un poco como se </span><span style="font-family: verdana,arial,helvetica,sans-serif;">hace con los m&#233;todos en .Net con la propiedad "override".</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">De momento, ya vemos un ahorro de c&#243;digo, y adem&#225;s el sistema est&#225; mejorado porque Sarissa para IE, va a hacer un loop </span><span style="font-family: verdana,arial,helvetica,sans-serif;">a trav&#233;s de los diferentes Activex que utiliza IE para crear el xmlHttpRequest hasta que encuentre el apropiado. Es </span><span style="font-family: verdana,arial,helvetica,sans-serif;">decir, los activeX:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">"Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Para la funci&#243;n getDatosXml. Tambi&#233;n ahorramos porque la forma de crear el objeto, lo har&#225; de modo conveniente </span><span style="font-family: verdana,arial,helvetica,sans-serif;">dependiendo del navegador, y adem&#225;s para IE mejorar&#225; el m&#233;todo haciendo un loop buscando la clase apropiada entre:<br /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></span><span style="font-family: verdana,arial,helvetica,sans-serif;">"Msxml2.DOMDocument.5.0", "Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", </span><span style="font-family: verdana,arial,helvetica,sans-serif;">"MSXML.DOMDocument", "Microsoft.XMLDOM"</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">En mi c&#243;digo, he incluido una mejora:<br /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></span><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">if(xmlhttp &amp;&amp; xmlhttp.readyState!=0 &amp;&amp; xmlhttp.readyState!=4){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; alert("espere mientras la conexi&#243;n anterior termina")</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">return;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}<br /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></span><span style="font-family: verdana,arial,helvetica,sans-serif;">Con lo cual nos aseguramos que las diferentes conexiones no se pisan.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">5.-</span>Incluyamos la funci&#243;n que controla la carga de datos del xmlhttprequest:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">function handlergetDatos(){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; if(xmlhttp.readyState==2)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; document.getElementById("lblError").innerHTML="Cargando datos";</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; if(xmlhttp.readyState==3)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; document.getElementById("lblError").innerHTML="Datos cargados";</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; if(xmlhttp.readyState==4)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; document.getElementById("lblError").innerHTML="Carga de datos completada";</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(xmlhttp.status==200)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">respuestaXML=xmlhttp.responseXML</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">mostrarDatos();</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }else{</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert("no se encuentra el documento xml")</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Aqu&#237; hemos mejorado la forma de hacer un seguimiento del estado de la conexi&#243;n.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Un detalle a tener en cuenta es que al final la funci&#243;n mostrarDatos, va a utilizar el objeto respuestaXML. En el caso </span><span style="font-family: verdana,arial,helvetica,sans-serif;">de cargarlo como documento XML usando load. La respuesta xml ya esta&#225; contenida en el objeto mismo,pero en el caso de </span><span style="font-family: verdana,arial,helvetica,sans-serif;">xmlhttpRequest, respuestaXML equivale a xmlhttp.responseXML.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Desde ese momento ambos XML son iguales y se tratan igual.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">6.-</span>Incluimos la funci&#243;n mostrarDatos:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">function mostrarDatos(){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">numNode=0;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">document.getElementById("lblError").innerHTML="";</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">try{</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">if(respuestaXML.parseError!=0){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">throw "Posible formato err&#243;neo:" + respuestaXML.parseError;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlmetatags=Sarissa.getText(respuestaXML.selectNodes("root/message/metatags")[numNode])</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmldescripcion=Sarissa.getText(respuestaXML.selectNodes("root/message/descripcion")[numNode])</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmldescripcionlarga=Sarissa.getText(respuestaXML.selectNodes("root/message/descripcionlarga")[numNode])</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sarissa.clearChildNodes(document.getElementById("metatags"))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sarissa.clearChildNodes(document.getElementById("descripcion"))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sarissa.clearChildNodes(document.getElementById("descripcionlarga"))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("metatags").appendChild(document.createTextNode(xmlmetatags))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("descripcion").appendChild(document.createTextNode(xmldescripcion))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("descripcionlarga").appendChild(document.createTextNode(xmldescripcionlarga))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">catch(e)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">{</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; document.getElementById("lblError").innerHTML="error cargando xml."+e+"&lt;br&gt;Lea la descripc&#237;on del error y </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">p&#243;ngase en contacto con su departamento t&#233;cnico:&lt;br&gt;"+Sarissa.getParseErrorText(respuestaXML);</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(51, 102, 102);" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Esta es la funci&#243;n que crea la magia.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Despu&#233;s de haber comprobado que se ha cargado sin problemas, seguimos haciendo comprobaciones:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; if(respuestaXML.parseError!=0){</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Con esto vamos a saber si el xml est&#225; mal formado.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Sarissa en este sentido nos ofrece 1 propiedad:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">respuestaXML.parseError</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">que deber&#237;a ser 0 si no hay error.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Y un m&#233;todo para recuperar el error:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Sarissa.getParseErrorText(respuestaXML)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Ahora es cuando utilizamos el segundo .js que incluimos sarissa_ieemu_xpath.js:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">xmlmetatags=Sarissa.getText(respuestaXML.selectNodes("root/message/metatags")[numNode])</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Con el m&#233;todo getText vamos a recuperar el valor del nodo que le indiquemos. Para eso utilizamos el selectNodes si hay </span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">m&#225;s de una misma etiqueta (en este caso metatags) con un &#237;ndice (numNode), o si fuera s&#243;lo uno, selectSingleNode.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><font size="2"><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">Fin</span></font><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Hasta aqu&#237; llega mi tutorial, un m&#233;todo muy bueno que utiliza google, ver:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;" /></font><font size="2"><a target="_blank" href="http://serversideguy.blogspot.com/2004/12/google-suggest-dissected.html">http://serversideguy.blogspot.com/2004/12/google-suggest-dissected.html</a></font><font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Es utilizar en vez de una respuesta xml, una respuesta de texto, y ejecutarla como javascript, as&#237;:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">eval(_xmlHttp.responseText)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Pero el lado de la fuerza incluye muchos otros m&#233;todos relacionados con hojas de estilo XML </span><span style="font-family: verdana,arial,helvetica,sans-serif;">( </span></font><font size="2"><a target="_blank" href="http://www-128.ibm.com/developerworks/xml/library/x-xslt/?article=xr">http://www-128.ibm.com/developerworks/xml/library/x-xslt/?article=xr</a></font><font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;"> ) que exploraremos otro d&#237;a.S&#243;lo mostraros un </span><span style="font-family: verdana,arial,helvetica,sans-serif;">ejemplo de diccionario basado en Google Suggests:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;" /><font size="2"><a target="_blank" href="http://www.objectgraph.com/dictionary/">http://www.objectgraph.com/dictionary/</a></font></font><font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Miguel &#193;ngel.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Programador.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">&nbsp;</span></font>
 ]]>
</description>
 <dc:date>2005-09-19T14:12:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

<item>
 <title>Instalar IIS bajo Windows XP Home Edition o el hijo descarriado de la edici&#243;n Home</title>
<link>http://widea.zoomblog.com/archivo/2005/09/19/instalar-Iis-bajo-Windows-Xp-Home-Edit.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2005/09/19/instalar-Iis-bajo-Windows-Xp-Home-Edit.html</guid>
 <description>
 <![CDATA[
Hay muchos programadores que despu&#233;s de comprarse un flamante port&#225;til &#250;ltimo modelo con m&#225;s caballos que un porsche, se llevan la ingrata sorpresa de que su sistema operativo<span style="font-weight: bold;"> Windows XP Home no soporta IIS!!!!!!</span><br /><br />Al principio, piensan que es un espejismo, se frotan bien los ojos, pero efectivamente no aparece en "Agregar componentes de Windows". Poco despu&#233;s, cogitan, y buscan por todos los lados y el IIS sigue escondido, el muy brib&#243;n!<br /><br />Pero lo cierto es que esos d&#243;lares que diferencian la versi&#243;n Professional de la Home crean un antes y un despu&#233;s a la hora de comprar el sistema operativo. <br /><br />Tal vez a aquellos que usan pirater&#237;a normalmente esto les importe un r&#225;bano, pero los legales y aquellos que no tienen ganas de ponerse a formatear su port&#225;til y agenciarse el sistema profesional, puede ser realmente un&nbsp; inconveniente molesto.<br /><br />Pero relaj&#233;monos, la comunidad web, en concreto <span style="font-weight: bold;">Richard Sandoz, nos ofrece</span> una alternativa con <span style="font-weight: bold;">un fant&#225;stico hack</span> que pod&#233;is encontrar por internet en ingl&#233;s (<a href="http://www.15seconds.com/issue/020118.htm" target="_blank">www.15seconds.com/issue/020118.htm</a>).<br /><br />Las explicaciones de R. Sandoz son muy diversas y desordenadas, adem&#225;s de omitir algunos pasos, y por lo tanto, altamente frustantes!!<br />El hackeador se merece un premio pero el profe suspenso!!<br /><br />Es mejor y m&#225;s detallada la explicaci&#243;n de adamV.com:<br /><a href="http://adamv.com/dev/articles/iis-on-xp-home" target="_blank">http://adamv.com/dev/articles/iis-on-xp-home</a><br /><br />Os hago un peque&#241;o resumen, que yo mismo he probado (o sufrido), y os doy unas referencias para que investigu&#233;is. <span style="font-weight: bold;">Cuando termin&#233;is este art&#237;culo, con suerte, tendr&#233;is vuestro IIS funcionando en el XP home!!</span><br /><br />Antes de nada decir una evidencia, no por conseguir el IIS en el Home estamos pasando un Home a Professional.<span style="font-weight: bold;"> Estas 2 ediciones del famoso OS tienen muchas m&#225;s diferencia</span>s, sobre todo en seguridad. Para ver un buen resumen:<br /><br /><a href="http://www.winsupersite.com/showcase/windowsxp_home_pro.asp" target="_blank">www.winsupersite.com/showcase/windowsxp_home_pro.asp</a><br /><br />Lo m&#225;s impresionante del hack es que <span style="font-weight: bold;">vamos a utilizar en realidad el IIS del Windows 2000</span> pro (necesitas el CD) para utilizarlo en el XP Home!!!<br />Antes de llegar a este punto, hagamos el trabajo sucio.<br /><br /><span style="font-weight: bold;">Empecemos:</span><br /><span style="font-weight: bold;">1.-</span>Localiza:<br /><span style="color: rgb(0, 102, 0);">C:WINDOWSINFSYSOC.INF</span><br /><br />Busca la entrada:<br />&nbsp;iis=iis.dll,OcEntry,iis.inf,hide,7<br /><br />Sustit&#250;yela por:<br /><span style="color: rgb(0, 102, 0);">&nbsp;iis=iis2.dll,OcEntry,iis2.inf,,7</span><br /><br /><span style="font-weight: bold;">2.</span>-Copia los archivos iis.dl_ and iis.in_ (el gui&#243;n bajo existe y no es un fallo, esto signifca que es un dll comprimido) del disco de Windows 2000 pro. Se encuentran en la carpeta i386 del disco de instalaci&#243;n.<br /><br /><span style="font-weight: bold;">3.-</span>Copia el iis.in_ en <span style="color: rgb(0, 102, 0);">C:WINDOWSINF y el iis.dl_</span> en&nbsp; <span style="color: rgb(0, 102, 0);">C:WINDOWSSYSTEM32SETUP</span>.<br /><br /><span style="font-weight: bold;">4.-</span>Abre una consola msdos y bajo cada uno de esos directorios de arriba, escribe bajo C:WINDOWSINF en msdos:<br /><span style="color: rgb(0, 102, 0);">expand iis.dl_ iis2.dll</span><br /><br />Escribe bajo C:WINDOWSSYSTEM32SETUP en msdos:<br /><span style="color: rgb(0, 102, 0);">expand iis2.in_ iis2.inf</span><br /><br />Con lo cual, hemos descomprimido los archivos que copiamos en las carpeta id&#243;neas, y el archivo sysoc.inf indicar&#225; a windows que busque esos archivos.<br /><br /><span style="font-weight: bold;">5.-</span>Ahora ya s&#243;lo nos queda ir a agregar/quitar programas&gt;agregar componentes de windows, y buscar en esa lista el IIS.<br />Marcamos la opci&#243;n y desmarcamos la casilla de SMTP, este servicio nos dar&#225; problemas si lo instalamos. <br /><br /><span style="font-weight: bold;">6.-</span>Siguiente. Nos pedir&#225; el CD. Utiliza el CD de Windows 2000 pro. Y busca la carpeta i386.<br /><br /><span style="font-weight: bold;">7.-</span>Una vez se haya instalado todo. Hemos hecho el camino m&#225;s duro, pero caminante no hay camino, y queda a&#250;n un trecho.<br /><br />De esta parte se olvidan casi todos los tutoriales que hay en internet pero es fundamental y no todo el mundo est&#225; al tanto.<br /><br />Al instalar un IIS del Windows 2000, este IIS va a utilizar la forma que ten&#237;a de gestionar la seguridad bajo aquel sistema operativo, pero en la edici&#243;n XP home ha variado. Ahora para el usuario an&#243;nimo, se necesita especificar el nombre de la m&#225;quina. En W2k s&#243;lo hace falta el IIS_NAME como usuario an&#243;nimo, cuando en XP home es NAME/IIS_NAME ("NAME" es el nombre de tu m&#225;quina, que puedes ver en propiedades de mi PC).<br /><br />Teletransp&#243;rtate a "Administrador de servicios Internet" o sea al Manager del IIS,y cliquea bot&#243;n derecho sobre el icono de tu ordenador. <br /><br />a.-Junto a Servicio WWW, cliquea Modificar.<br />b.-elige la pesta&#241;a Seguridad de directorio<br />c.-verifica las casillas de acceso an&#243;nimo y seguridad de windows integrada.<br />d.-cliquea Modificar de acceso an&#243;nimo.<br />e.-En el formulario de Cuenta de Usuario An&#243;nimo desverifica "permitir que IIS controle contrase&#241;as"<br />f.-Ahora Examinar, y tienes que buscar el usuario IUSR_NAME ("NAME" es el nombre de tu m&#225;quina), lo seleccionas, aceptas las pantallas precedentes y ahora aparecer&#225; el usuario NAME/IUSR_NAME ("NAME" es el nombre de tu m&#225;quina).<br />g.-Acepta todas las pantallas y OK.<br /><br /><span style="font-weight: bold;">8.-</span>Comprueba escribiendo un archivo asp bajo wwwroot, y http://localhost/NombreArchivo.asp.<br /><br />Y voil&#224;!!!!!<br /><br />Con esto hemos efectuado un largo camino, para algunos tal vez demasiado pesado y antes de terminar el tutorial, han instalado el XP Pro.<br /><br />Esto era la primera parte.<br /><br />La segunda parte habla del Visual Studio 2003 y el IIS que hemos hackeado.<br /><br /><span style="font-weight: bold;">1.-</span>Instalamos el Visual Studio 2003 (por supuesto y como es obligatorio, con todos sus "prerequisites" o requisitos previos).<br /><br /><span style="font-weight: bold;">2.-</span>Depuramos y fallo, no se encuentra el filtro de ASP.NET.<br /><br /><span style="font-weight: bold;">3.-</span>Esto no s&#243;lo nos pasa a nosotros los hackeadores de post&#237;n.<br /><br />Tenemos que registrar la dll para que aparezca como filtro en los filtros Isapi del IIS, para navegamos a:<br />&lt;DRIVE&gt;:WINDOWSMicrosoft.NETFramework&lt;FRAMEWORK VERSION&gt;<br /><br />(normalmente:<br />C:WINNTMicrosoft.NETFramework&#11;1.1.4322)<br /><br />Y picamos:<br /><br /><span style="color: rgb(0, 102, 0);">asp_regiis -i</span><br /><br />Tambi&#233;n funcionar&#237;a:<br /><br /><span style="color: rgb(0, 102, 0);">regsvr32 aspnet_isapi.dll</span><br /><br /><br /><br />Este deber&#237;a ser el fin de nuestros problemas, pero a m&#237; me acos&#243; otro error. Segu&#237; sin hacer funcionar el .NET, y el motivo era que no ten&#237;a permisos para escribir en el wwwroot.<br /><br />Esto se soluciona cambiando la carpeta ra&#237;z de nuestro IIS en el "Administrador de Servicios de Internet" a una nueva carpeta que creemos, o simplemente, cambi&#225;ndole los permisos a la carpeta wwwroot.<br /><br />Bueno, espero haber servido de ayuda, este art&#237;culo se lo dedico a todos aquellos que perdieron su tiempo para ayudar a los enmarronados del XP Home.<br /><br /><span style="font-weight: bold;">M.A.</span><br style="font-weight: bold;" /><span style="font-weight: bold;">Programador.</span><br /><br />
 ]]>
</description>
 <dc:date>2005-09-19T09:10:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

<item>
 <title>Clase para creaci&#243;n autom&#225;tica de Datagrids</title>
<link>http://widea.zoomblog.com/archivo/2005/09/12/clase-para-creacion-automatica-de-Data.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2005/09/12/clase-para-creacion-automatica-de-Data.html</guid>
 <description>
 <![CDATA[
<p>A veces nos hemos preguntado. &#191;Y si fuera m&#225;s f&#225;cil y m&#225;s claro en ASP hacer un datagrid sin tener todos los c&#243;digos html y asp entremezclados?<br />Qu&#233; gran injusticia sentimos cuando programamos en asp, y no podemos utilizar el control DataGrid de .Net!!! Qu&#233; desgracia para un purista ver todos esos comandos enredados y apelogotonados!!</p>
<p>No nos quejemos que los c&#243;digos est&#225;n en nuestras manos para intentar crear la ilusi&#243;n de que todo se automatiza m&#225;s.<br />Los controles de .Net no son m&#225;s que clases y por lo tanto cualquier otro lenguaje puede imitarlo, aunque sin el soporte de la magn&#237;fica plataforma de Visual Studio.</p>
<p>He programado una clase que tiene bastantes posibilidades, aunque no la he perfeccionado, quer&#237;a ofrecerla aqu&#237; al mundo internauta y si alguien tiene el tiempo y la paciencia de perfeccionarla. Please, make me know!!</p>
<p>Vamos a producir un Datagrid con esta clase que pagina cada 30 &#237;tems y que va a mostrar hasta 20 n&#250;meros a los que navegar, que adem&#225;s mostrar&#225; enlaces de "inicio", "anterior", "siguiente" y "fin.</p>
<p><font color="#006600">dim updateGrid</font></p>
<p><font color="#006600">set updateGrid=new HtmlDatagrid</font></p>
<p><font color="#006600">updateGrid.arConexion=arConexion</font></p>
<p><font color="#006600">updateGrid.arCampos= Array("idcentro","nombre","direccion","codigopost","prov","telefono")</font></p>
<p><font color="#006600">updateGrid.strOrder="nombre ASC"</font></p>
<p><font color="#006600">updateGrid.arCamposVisible=Array(0,1,1,1,1,1)</font></p>
<p><font color="#006600">updateGrid.arThCampos=Array("id","Nombre","Direcci&#243;n","C&#243;digo Postal","Provincia","Tel&#233;fono")</font></p>
<p><font color="#006600">updateGrid.btnPaginar=1 'con esto hacemos que aparezcan los botones de inicio etc...</font></p>
<p><font color="#006600">updateGrid.numPaginar=30</font></p>
<p><font color="#006600">updateGrid.numerosPaginacion=20</font></p>
<p><font color="#006600">updateGrid.TableAttr="cellSpacing=""1"" id=""itemstable"" cellPadding=""1"" width=""100&#37;"" border=""0"" style=""margin-top:30px""&nbsp;&nbsp; summary=""Resultados de b&#250;squeda de centros, dividido en: nombre, direcci&#243;n y tel&#233;fono"""<br />'estilos de las filas</font></p>
<p><font color="#006600">updateGrid.arAttr= Array ("valign='top' align='center'","valign='top'","valign='top'","valign='top' align='center'","valign='top'","valign='top'")<br />'estilos de la cabecera</font></p>
<p><font color="#006600">updateGrid.arThAttr=Array("class=""fondocolorlogoclaro"" width=""60"" align=""left""","class=""fondocolorlogoclaro"" width=""120"" align=""left""","class=""fondocolorlogoclaro"" width=""160"" align=""left""","class=""fondocolorlogoclaro"" width=""100"" align=""center""","class=""fondocolorlogoclaro"" width=""120"" align=""left""","class=""fondocolorlogoclaro"" width=""120"" align=""left""")</font></p>
<p><font color="#006600">updateGrid.display()</font></p>
<p>Como se ve es bastante sencillo.</p>
<p>Pero bueno, estudiemos el abracadabra-pata-de-cabra del c&#243;digo.</p>
<p>1.-Creamos la instancia de la clase. </p>
<p><font color="#006600">set updateGrid=new HtmlEditDatagrid</font></p>
<p>2.-Le asignamos la conexi&#243;n que debe ser un array con 5 valores:</p>
<p><font color="#006600">updateGrid.arConexion=arConexion</font></p>
<p>tal que as&#237;:</p>
<p><font color="#006600">Dim arConexion(5) 'array de conexion<br />arConexion(0)="SQLOLEDB" 'proveedor de base de datos<br />arConexion(1)="servidor" 'direccion del servidor<br />arConexion(2)="basededatos" 'base de daots<br />arConexion(3)="usuario"<br />arConexion(4)="contrase&#241;a"<br />arConexion(5)="tabla"</font></p>
<p>3.-Definimos los campos que vamos a recoger de nuestra consulta a la base de datos en un array, y c&#243;mo queremos que aparezcan ordenados:</p>
<p><font color="#006600">updateGrid.arCampos= Array("idcentro","nombre","direccion","codigopost","prov","telefono")</font></p>
<p><font color="#006600">updateGrid.strOrder="nombre ASC"</font></p>
<p>4.- Le colocamos el nombre de cabecera que se nos antoje, pero queremos que no aparezca una columna que se llame id, as&#237; que con la propiedad arCamposVisible le asignamos un 0:</p>
<p><font color="#006600">updateGrid.arThCampos=Array("id","Nombre","Direcci&#243;n","C&#243;digo Postal","Provincia","Tel&#233;fono")</font></p>
<p><font color="#006600">updateGrid.arCamposVisible=Array(0,1,1,1,1,1)</font></p>
<p>5.-Ahora definimos c&#243;mo queremos paginar:</p>
<p><font color="#006600">updateGrid.btnPaginar=1 'igualado a 1, incluimos hiperenlaces a inicio, anterior,siguiente&#133; </font></p>
<p><font color="#006600">updateGrid.numPaginar=30 'mostrar 30 &#237;tems</font></p>
<p><font color="#006600">updateGrid.numerosPaginacion=20 'mostrar hiperenlaces a 20 p&#225;ginas<br /></font><br />6.-Lo dem&#225;s: updateGrid.TableAttr, updateGrid.arAttr, updateGrid.arThAttr<br />&nbsp;sirve para definir los estilos de la tabla, de las filas y la cabecera etc&#133;</p>
<p>7.-Finalmente lo mostramos:</p>
<p><font color="#006600">updateGrid.display()</font></p>
<p>Para realizar esta maravilla os dejo la clase m&#225;s abajo, pero aviso, no est&#225; nada pulida, pero cubre bastantes de las necesidades del d&#237;a a d&#237;a del programador. </p>
<p>Con esta clase he podido hacer tambi&#233;n que las filas sean editables, sin tocar casi nada, tambi&#233;n se pueden separar las celdas por celdas de im&#225;genes que no tengan ninguna funcionalidad, se pueden agrupar campos y colocarlos en uno s&#243;lo, se puede crear un filtro en la consulta (where x like '&#37;x&#37;'),&nbsp; etc&#133;</p>
<p>Ya ir&#233; mostrando otros ejemplos sobre el uso de esta clase en el futuro.</p>
<p><strong>CLASE HTMLDATAGRID:<br /></strong><strong><span lang="en"><span style="COLOR: rgb(0,0,153)"></span></span></strong></p>
<p><span lang="en"><span style="COLOR: rgb(0,0,153)">class HtmlDatagrid</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public arConexion</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public arCampos</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public arCamposVisible</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public arFilter</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public strAdicional</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public strOrder</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public TableAttr</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public arThcampos</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public arThAttr</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public arAttr</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public numPaginar</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public numerosPaginacion</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public separadorCells</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public btnCampos</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public classTr</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">public btnPaginar</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">function display()</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Response.Write(me.createDataGrid())</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end function</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">function createDataGrid()</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim conn1&nbsp; 'la conexi&#243;n</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim rs1&nbsp;&nbsp;&nbsp; 'el recordset</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim strQuery 'cadena de la consulta</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim strCells 'el resultado devuelto: las celdas</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim arCamposLen 'longitud del array de campos</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim pagina_actual 'por si estamos paginando recupera el valor de p&#225;gina actual</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">on error resume next</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">arCamposLen=Ubound(arCampos)</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">set conn1=Server.CreateObject("ADODB.Connection") </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">conn1.ConnectionString="Provider=" &amp; arConexion(0) &amp; ";Data Source=" &amp; arConexion(1) &amp; ";Initial Catalog=" &amp;arConexion(2) &amp; ";uid=" &amp; arConexion(3) &amp; ";PWD=" &amp; arConexion(4)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">conn1.Open</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'----------------[creaci&#243;n de recordset]---------------</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">set rs1=Server.CreateObject("ADODB.Recordset") </span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'ordenaci&#243;n por strOrder</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.Sort=strOrder</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.ActiveConnection=conn1</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.CursorType=1</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.LockType=3</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.CursorLocation=3</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'-----------construimos cadena de la consulta</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Dim i 'dummy</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Dim campo 'dummy</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for i=0 to arCamposLen</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'si el campo es un array</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'puede ser un array porque es posible que queramos agrupar</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'varios campos en una fila</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if isArray(arCampos(i)) then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for each campo in arCampos(i)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strQuery=strQuery &amp; campo</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strQuery=strQuery &amp; ","</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; next</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'si el campo no es un array</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strQuery=strQuery &amp; arCampos(i)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strQuery=strQuery &amp; ","</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end if</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; next</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'le quitamos la &#250;ltima coma</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strQuery=left(strQuery,Len(strQuery)-1)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'------------------[filtramos seg&#250;n arFilter]</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if isArray(arFilter) then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; Dim strFilter</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; Dim strSeparadorIni</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; Dim strSeparadorFin</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; 'nuestro filtro incluye 3 campos as&#237; que saltamos de 3 en 3</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; for i=0 to Ubound(arFilter) step 3</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; 'aqu&#237; es donde vamos a utilizar un tipo de operador u otro</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; if arFilter(i+1)="like" then</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; strSeparadorIni="'&#37;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; strSeparadorFin="&#37;'"</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; else</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; strSeparadorIni="'"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; strSeparadorFin="'"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; strFilter=strFilter &amp; arFilter(i) &amp; " " &amp; arFilter(i+1) &amp; strSeparadorIni &amp; arFilter(i+2) &amp; strSeparadorFin &amp; "and "</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; next</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; 'le extraemos el &#250;ltimo "and"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; strFilter=left(strFilter,Len(strFilter)-4)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; strFilter=" where " &amp; strFilter</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strQuery="select " &amp; strAdicional &amp; strQuery &amp; " from " &amp; arConexion(5) &amp; strFilter</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'Response.Write(strQuery)</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.Source=strQuery</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.Open</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if not rs1.EOF then 'if -rs1.eof</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'--------recuperamos la p&#225;gina en la que nos encontramos en caso de estar paginando</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim strResults ' recoge los n&#250;meros de la paginaci&#243;n etc...</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim numRegistros 'n&#250;mero de registros del recordset</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">numRegistros=rs1.recordcount</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'Response.Write(numRegistros)</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if numPaginar&lt;&gt;"" and numRegistros&gt;numPaginar then '--------if-paginacion</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if (request.queryString("page") &lt;&gt; "") then </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; pagina_actual = request.queryString("page")</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">else</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; pagina_actual = 1</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;'si existe alg&#250;n resultado, ejecuta el resto</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.pagesize=numPaginar</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.absolutePage = pagina_actual 'nos situamos en la p&#225;gina actual</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'---------creamos el &#237;ndice de p&#225;ginas</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'resultados</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strResults=strResults &amp; "&lt;br&gt;Resultados &lt;b&gt;" &amp; (pagina_actual*numPaginar-numPaginar+1) &amp; " a " &amp; ((pagina_actual*numPaginar)) &amp; "&lt;/b&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strResults=strResults &amp; "&lt;br&gt;&lt;br&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strResults=strResults &amp; "&lt;center&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if pagina_actual &lt;&gt;1 then</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'hacemos que aparezcan los botones de inicio etc...</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if btnPaginar&lt;&gt;"no" then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strResults=strResults &amp; "&lt;a href=""?page=1"" class=""paginar"" title=""ir a inicio""&gt;[Inicio]&lt;/a&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strResults=strResults &amp; "&lt;a title=""Ir a pagina anterior"" class=""paginar"" href=""?page=" &amp; (pagina_actual-1) &amp; """&gt;[Anterior]&lt;/a&gt;"</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'n&#250;meros de paginaci&#243;n</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim k 'dummy</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim hrefClass 'la clase de los n&#250;meros</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">k=1</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim numDiv 'nos va a servir para corregir un error</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim numPag</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">numPag=0 'guarda n&#250;mero del menu de las p&#225;ginas que se muestra </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Do While k &lt;= rs1.PageCount</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">numDiv=roundDown(pagina_actual/numerosPaginacion)</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if pagina_actual mod numerosPaginacion = 0 then</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; numDiv=numDiv-1</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; numPag=numDiv*numerosPaginacion</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; numPag=numPag+k</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'s&#243;lo vamos a mostrar numerosPaginacion p&#225;ginas</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if k&lt;=numerosPaginacion and numPag&lt;=rs1.PageCount then</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; 's&#243;lo vamos a mostrar numerosPaginacion p&#225;ginas</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if rs1.PageCount&gt;numerosPaginacion then</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if numPag=cint(pagina_actual)&nbsp;&nbsp; then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">hrefClass="negrita"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">else</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">hrefClass="paginarN"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strResults=strResults &amp; "&amp;nbsp;&lt;b&gt;&lt;a title=""ir a pagina " &amp; numPag &amp; """ class=""" &amp; hrefClass &amp; """ href=""?page=" &amp; numPag &amp; """&gt;" &amp; numPag &amp; "&lt;/a&gt;&amp;nbsp;&lt;/b&gt;"</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">else</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if k=cint(pagina_actual)&nbsp;&nbsp; then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">hrefClass="negrita"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">else</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">hrefClass="paginarN"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strResults=strResults &amp; "&amp;nbsp;&lt;b&gt;&lt;a title=""ir a pagina " &amp; k &amp; """ class=""" &amp; hrefClass &amp; """ href=""?page=" &amp; k &amp; """&gt;" &amp; k &amp; "&lt;/a&gt;&amp;nbsp;&lt;/b&gt;"</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">k=k+1</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; else </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; exit do</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Loop</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'insertamos letreros de siguiente y fin</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if cint(pagina_actual)&lt;&gt; rs1.PageCount then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if btnPaginar&lt;&gt;"no" then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strResults=strResults &amp; "&lt;a href=""?page="&amp; (pagina_actual+1) &amp; """ class=""paginar"" title=""ir a p&#225;gina siguiente""&gt;[Siguiente]&lt;/a&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strResults=strResults &amp; "&lt;a title=""Ir a p&#225;gina final"" class=""paginar"" href=""?page=" &amp; (rs1.PageCount) &amp; """&gt;[Fin]&lt;/a&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end if</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strResults=strResults &amp; "&lt;/center&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strCells=strCells &amp; strResults</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if '-------if-paginacion</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'-------------------[loop: creaci&#243;n de cabecera]-------------------</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strCells=strCells &amp; "&lt;table " &amp; TableAttr &amp; "&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim j 'dummy</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if isArray(arThcampos) then'if-arthAttr</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strCells=strcells &amp; "&lt;tr&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">for j=0 to arCamposLen</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; if arCamposVisible(j)=1 then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; strCells=strCells &amp; "&lt;TH " &amp; arThAttr(j) &amp; "&gt;&lt;b&gt; " &amp; arThcampos(j) &amp; "&lt;/b&gt; &lt;/TH&gt;"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; end if </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp; next</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strCells=strCells &amp; "&lt;/tr&gt;"</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if'if-arthAttr</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'----------------[loop: creaci&#243;n de tabla]---------------</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if numPaginar="" then 'colocamos la paginaci&#243;n m&#225;s all&#225; de cualquier l&#237;mite si no existe</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">numPaginar=100000</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Dim cuentaRegistros</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">cuentaRegistros=0 'contaremos cu&#225;ntos registros muestra para que pare en numPaginar</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim cellValue 'valor de los campos, de no haber, se sustituye por &amp;nbsp; en caso de que utilicemos bordes es &#250;til</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim m 'dummy</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim boton 'variable que utilizaremos si hay botones</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">dim campovalor'tambien lo utilizamos si hubiera botones</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if classTr&lt;&gt;"" then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">classTr="class=""" &amp; classTr &amp; """"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">do while not rs1.EOF and cuentaRegistros&lt;numPaginar</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">cuentaRegistros=cuentaRegistros+1 'esto har&#225; que se pare en numPaginar</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strCells=strCells &amp; "&lt;tr " &amp; classTr &amp; " &gt;"</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'creamos las celdas</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for j=0 to arCamposLen 'for-arcamposlen</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cellValue=""</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'si queremos que se vea</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if arCamposVisible(j)=1 then 'if -visible</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'si es una agrupaci&#243;n de valores</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if IsArray(arCampos(j)) then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m=0</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for each campo in arCampos(j)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cellValue=cellValue &amp; rs1(campo)&amp; arGroupFSeparators(m)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m=m+1</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; next</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'si es bot&#243;n es que el campo es "' ' as"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'si es un alias para crear botones etc...</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; elseif left(arCampos(j),1)="'" then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; boton=btnCampos(j)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; campovalor=arCampos(j)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; campovalor=mid(campovalor,2,1)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; campovalor=arCampos(campovalor)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; campovalor=rs1(campovalor)</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; execute("cellValue=" &amp; boton &amp; "(""" &amp; campovalor &amp; """)" )</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if rs1(arCampos(j))="" or rs1(arCampos(j))=" " or rs1(arCampos(j))="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " then</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cellValue="&amp;nbsp"</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cellValue=rs1(arCampos(j))</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end if</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end if</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strCells=strCells &amp; "&lt;TD " &amp; arAttr(j) &amp; "&gt;"&amp; cellValue &amp; "&lt;/td&gt;"</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end if'if -visible&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; next 'for-arcamposlen</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strCells=strCells &amp; "&lt;/tr&gt;"</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'si hay un separador de celdas que hayamos pasados como par&#225;metro</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if separadorCells&lt;&gt;"" then</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,