Esta pregunta hace referencia a una funcion aportada por U goldman en un mensaje con el titulo Biblioteca de Clases,Funciones y Sub-rutinas.
http://www.forosdelweb.com/f15/biblioteca-clases-funciones-sub-rutinas-238829/
Este es el error que obtengo:
Tipo de error:
ADODB.Recordset (0x800A0BB9)
Argumentos incorrectos, fuera del intervalo permitido o en conflicto con otros.
/webgs/valormaximo.asp, línea 20
Esta es la linea 20
rsGetMyMaxId.Open strSQLGetMyLastId, OConn, 3, 3
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #INCLUDE File="adovbs.inc" -->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Dim oConn
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open ("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("basedatos.mdb"))
%>
<%
Function GetMyMaxId(table, field)
Set rsGetMyMaxId = Server.CreateObject("ADODB.Recordset")
strSQLGetMyMaxId = "SELECT MAX(" & field & ") AS myMax FROM " & table
rsGetMyMaxId.Open strSQLGetMyLastId, OConn, 3, 3
fnctMyMaxId = rsGetMyLastId("myMax")
If IsNull(fnctMyMaxId) Then
fnctMyMaxId = 0
End If
rsGetMyMaxId.Close
Set rsGetMyMaxId = Nothing
GetMyMaxId = fnctMyMaxId
End Function
%>
<%MaxID = GetMyMaxId("productos", "lecturas") %>
<%=MaxID %>
<%oConn.Close
%>
</body>
</html>