<?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: ASP</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-05T14:25:00+01:00</dc:date>
<lastBuildDate>Mon, 12 May 2008 08:12: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>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>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,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strCells=strCells &amp; separadorCells</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; end if</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)">rs1.MoveNext</span><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)" /><span style="COLOR: rgb(0,0,153)">'cerramos tabla</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strCells=strCells &amp; "&lt;/table&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)">'------------paginaci&#243;n 2</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if numPaginar&lt;&gt;"" and numRegistros&gt;numPaginar then</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)" /><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)">else 'if -rs1.eof</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)">Response.Write ("&lt;br&gt;No se ha encontrado ning&#250;n registro&lt;br&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 'if -rs1.eof</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'--------------[destrucci&#243;n de objetos]---------------</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.Close</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">set rs1=nothing</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)">conn1.Close</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">set conn1=nothing</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)">if err&lt;&gt;0 then</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Response.Write("&lt;font color=red&gt;Ha habido un error en la ejecuci&#243;n de esta p&#225;gina. Int&#233;ntelo de nuevo&lt;/font&gt;")</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)" /><span style="COLOR: rgb(0,0,153)">On Error GoTo 0</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)">createDataGrid=strCells</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)">end class</span><br style="COLOR: rgb(0,0,153)" /><span lang="en" style="COLOR: rgb(0,0,153)"><br /></span></span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">class HtmlEditDatagrid</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,0,153)" /><span style="COLOR: rgb(0,0,153)">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strCells=strCells &amp; separadorCells</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; end if</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)">rs1.MoveNext</span><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)" /><span style="COLOR: rgb(0,0,153)">'cerramos tabla</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">strCells=strCells &amp; "&lt;/table&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)">'------------paginaci&#243;n 2</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">if numPaginar&lt;&gt;"" and numRegistros&gt;numPaginar then</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)" /><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)">else 'if -rs1.eof</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)">Response.Write ("&lt;br&gt;No se ha encontrado ning&#250;n registro&lt;br&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 'if -rs1.eof</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">'--------------[destrucci&#243;n de objetos]---------------</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">rs1.Close</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">set rs1=nothing</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)">conn1.Close</span><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">set conn1=nothing</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)">if err&lt;&gt;0 then</span><br style="COLOR: rgb(0,0,153)" /><br style="COLOR: rgb(0,0,153)" /><span style="COLOR: rgb(0,0,153)">Response.Write("&lt;font color=red&gt;Ha habido un error en la ejecuci&#243;n de esta p&#225;gina. Int&#233;ntelo de nuevo&lt;/font&gt;")</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)" /><span style="COLOR: rgb(0,0,153)">On Error GoTo 0</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)">createDataGrid=strCells</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)">end class</span><br style="COLOR: rgb(0,0,153)" /><span lang="en" style="COLOR: rgb(0,0,153)"><br /></span></p>
 ]]>
</description>
 <dc:date>2005-09-12T09:58:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

</channel>
</rss>

