<%if request.form("usuario")="" then%>

 

 

 

<%=request.querystring("msg")%>

Login

Usuario:

Password:

<%else usuario=replace(request.form("usuario"),"'","") password=replace(request.form("password"),"'","") Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\base\bd2.mdb")) set rs = CreateObject("ADODB.Recordset") sqltxt="Select * from Tabla1 where usuario='"&usuario&"' and password= '"&password&"'" rs.Open sqltxt, conn if not rs.eof then if rs("usuario")=usuario and rs("password")=password then session("autorizacion")=1 response.redirect "page.asp" end if else session("autorizacion")=-1 end if rs.close set rs=nothing conn.close set conn=nothing if session("autorizacion")=-1 or session("autorizacion")="" then response.redirect "login.asp?msg=Usuario%20o%20password%20incorrecta" end if end if%>