
13/02/2008, 14:14
|
| | Fecha de Ingreso: febrero-2008
Mensajes: 16
Antigüedad: 17 años, 3 meses Puntos: 0 | |
Re: ayuda error objeto cerrado Gracias goldman por responder, este es el código del archivo donde apunta el error
Function PaginaGridRadio(SQL, Nombre, vDefault, Forma, ItemsPorPagina,OrderField)
Dim Columnas, Registros, TRClass, lsName, CuentaRegistros, lsField, MorePaginas, ToMuchPaginas
Dim puntero
Dim Pagina
Dim Order
Dim FiltraRegistro
Dim Rs
Dim RegistrosInt
Dim RegistrosTot
Dim MyQuery,MyWhere
if not IsEmpty(Request.Form("_ItemsPagina")) Then
ItemsPorPagina=Request.Form("_ItemsPagina")
End if
if IsEmpty(Request.Form("_Pagina")) Then
Pagina="0"
Else
Pagina=Request.Form("_Pagina")
End if
if isEmpty(Request.Form("_Order")) then
Order = OrderField
Else
Order = Request.Form("_Order")
End if
%>
<script language="javascript">
function DoPagina(Pagina){
wShow();
<%=Forma%>._Pagina.value=Pagina;
<%=Forma%>.submit();
}
function Ordena(Columna){
if (<%=Forma%>._Order.value==Columna){
<%=Forma%>._Order.value=Columna+" desc";
} else {
<%=Forma%>._Order.value=Columna;
}
DoPagina('0');
}
</script>
<%
On Error Resume Next
If not isEmpty(Request.Form("_Columnas")) Then
MyWhere=""
For puntero = 1 to Request.Form("_Columnas")-1
If (not isEmpty(Request.Form("_FiltroGrid" & puntero))) and (Trim(Request.Form("_FiltroGrid" & puntero))<>"") then
If MyWhere="" Then
MyWhere = " where " & Request.Form("_NameGrid" & puntero) & " like '%" & Replace(Replace(Trim(Request.Form("_FiltroGrid" & puntero))," ","%"),"'","''") & "%' COLLATE latin1_spanish_ci "
Else
MyWhere = MyWhere & " and " & Request.Form("_NameGrid" & puntero) & " like '%" & Replace(Replace(Trim(Request.Form("_FiltroGrid" & puntero))," ","%"),"'","''") & "%' COLLATE latin1_spanish_ci "
End if
End if
Next
End if
MyQuery="select * from (" & SQL & ") x " & MyWhere & " order by " & Order & " limit " & ItemsPorPagina*(Pagina+5)
set rs=ConsultarSQL(MyQuery)
On Error goto 0
Columnas=rs.Fields.Count
%><input type="hidden" name="_Columnas" value=<%=Columnas%>><%
Registros = 0
TRClass="Dark"
%><tr><%
%><td class="SubEncabezado" align="center"></TD><%
For puntero = 1 to rs.Fields.Count - 1
%><td class="SubEncabezado" align="center"><%
%><input type="text" name="_FiltroGrid<%=puntero%>" value="<%=Request.Form("_FiltroGrid" & puntero)%>" size="7" onChange="javascript:DoPagina('0');"><%
%></td><%
Next
For puntero = 1 to rs.Fields.Count - 1
%><input type="hidden" name="_NameGrid<%=puntero%>" value="<%=rs.Fields(puntero).Name%>" ><%
Next
%></tr><%
%><tr><%
%><td class="SubEncabezado" align="center"></TD><%
For puntero = 1 to rs.Fields.Count - 1
%><td class="SubEncabezado" align="center"><%
%><a href="#" onClick="Ordena('<%=puntero+1%>')"><%
if isnull(rs.Fields(puntero).Name) then
lsName= ""
else
lsName= rs.Fields(puntero).Name
End if
Response.Write lsName
%></a><%
If Order=(puntero+1) & "" then
%> <img src="../images/down.gif" WIDTH="13" HEIGHT="8"><%
End if
If Order=(puntero+1) & " desc" then
%> <img src="../images/up.gif" WIDTH="13" HEIGHT="8"><%
End if
If (not isEmpty(Request.Form("_FiltroGrid" & puntero))) and (Request.Form("_FiltroGrid" & puntero)<>"") then
%> <img src="../images/funnel.gif" WIDTH="16" HEIGHT="15"><%
End if
%></td><%
Next
%></tr><%
For CuentaRegistros=1 to Pagina*ItemsPorPagina
if rs.EOF then
Exit for
end if
FiltraRegistro=True
'For puntero = 0 to rs.Fields.Count - 1
' If (not isEmpty(Request.Form("_FiltroGrid" & puntero))) and (Request.Form("_FiltroGrid" & puntero)<>"") then
' FiltraRegistro = ((instr(1,rs.Fields(puntero),Request.Form("_Filtro Grid" & puntero),vbTextCompare)>0)) and FiltraRegistro
' End if
'Next
If FiltraRegistro Then
Registros=Registros+1
Else
CuentaRegistros=CuentaRegistros-1
End if
rs.MoveNext
next
if rs.EOF then <----- esta es la línea 603
Pagina=0
If not (rs.EOF and rs.BOF) then
rs.MoveFirst
End if
End if
Y esta es la parte del código del archivo global.asa que apunta a la BD
sub Application_OnStart
application("strDSN") ="DSN=AMABDI;user ID=root;Password=ama"
end sub
Por supuesto estos valores son los mismos que el ODBC. En verdad necesito resolver este error, así que si necesitas más información de como está la situasión pídemela. Gracias |