% Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 Const adOpenDynamic = 2 Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 Const adLockBatchOptimistic = 4 usuario=request.form("usuario") contra=request.form("contra") if isempty(usuario) then id=0 cabecera="cabecera.asp?mostrar=Accede%20a%20tu%20cuenta&titulo=Portada" principal="portada.asp" else Set conn = Server.CreateObject("ADODB.Connection") conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("base.mdb")) set obj=createobject("ADODB.Recordset") obj.CursorType = adOpenKeyset obj.LockType = adLockOptimistic txt = "SELECT * FROM Usuarios WHERE Usuario='" & usuario & "' and Contra='" & contra & "'" obj.open txt, conn if not obj.eof then nombre=replace(obj("Nombre")," ","%20") cabecera="cabecera.asp?mostrar=" & obj("Usuario") & "&titulo=" & nombre principal=obj("Direccion") else cabecera="cabecera.asp?mostrar=error&titulo=Portada" principal="portada.asp" end if obj.close set obj=nothing conn.close set conn=nothing end if %>