Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Guilherme Teixeira

Erro ao fazer login

Recommended Posts

Olá amigos,

 

estou fazendo uma página para login com o dreamweaver, porém depois de tantas que deram certo, esta não sei por que resolveu não funcionar. Ela acusa o seguinte erro:

 

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)

[Microsoft][Driver ODBC para Microsoft Access] A cláusula LEVEL inclui uma palavra reservada ou um argumento que está incorreto ou faltando, ou a pontuação está incorreta.

/gmt/users/index.asp, line 29

 

E o meu código é este:

CODE
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

<!--#include file="../Connections/GMT.asp" -->

<%

' *** Validate request to log in to this site.

MM_LoginAction = Request.ServerVariables("URL")

If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)

MM_valUsername = CStr(Request.Form("user"))

If MM_valUsername <> "" Then

Dim MM_fldUserAuthorization

Dim MM_redirectLoginSuccess

Dim MM_redirectLoginFailed

Dim MM_loginSQL

Dim MM_rsUser

Dim MM_rsUser_cmd

 

MM_fldUserAuthorization = "level"

MM_redirectLoginSuccess = "user.asp"

MM_redirectLoginFailed = "error.asp"

 

MM_loginSQL = "SELECT usuario, senha"

If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization

MM_loginSQL = MM_loginSQL & " FROM usuarios WHERE usuario = ? AND senha = ?"

Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")

MM_rsUser_cmd.ActiveConnection = MM_GMT_STRING

MM_rsUser_cmd.CommandText = MM_loginSQL

MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar

MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("senha")) ' adVarChar

MM_rsUser_cmd.Prepared = true

Set MM_rsUser = MM_rsUser_cmd.Execute

 

If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then

' username and password match - this is a valid user

Session("MM_Username") = MM_valUsername

If (MM_fldUserAuthorization <> "") Then

Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)

Else

Session("MM_UserAuthorization") = ""

End If

if CStr(Request.QueryString("accessdenied")) <> "" And false Then

MM_redirectLoginSuccess = Request.QueryString("accessdenied")

End If

MM_rsUser.Close

Response.Redirect(MM_redirectLoginSuccess)

End If

MM_rsUser.Close

Response.Redirect(MM_redirectLoginFailed)

End If

%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>GMT Web Services - Área do Cliente</title>

<style type="text/css">

<!--

body,td,th {

font-family: Arial;

font-size: 12px;

}

-->

</style></head>

 

<body>

<p align="center"><img src="files/logo.jpg" width="149" height="134" /><br />

<br /></p>

 

Olá Seja Bem vindo, <p>esta é área do cliente <strong>GMT Web Services</strong>. Neste espaço você tem acesso a dados referentes ao trabalho contrato e também acesso ao andamento do trabalho se este ainda estiver em desenvolvimento. Faça seu login para obter acesso a este serviço:<br />

</p>

<form ACTION="<%=MM_LoginAction%>" METHOD="POST" id="form1" name="form1">

<table width="234" height="125" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">

<tr>

<td><table border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="35"><div align="right"><strong>Usuário:   </strong></div></td>

<td><label>

<input type="text" name="user" id="user" />

</label></td>

</tr>

<tr>

<td height="35"><div align="right"><strong>Senha:   </strong></div></td>

<td><label>

<input type="password" name="senha" id="senha" />

</label></td>

</tr>

<tr>

<td height="17" colspan="2" align="center" valign="middle"><div align="center">

<input type="submit" name="confirm" id="confirm" value="Login" />

</div></td>

</tr>

</table></td>

</tr>

</table>

</form>

<p>Caso tenha problemas com o acesso favor entrar em contato pelo:<br />

<br />

<img src="files/msn.jpg" width="43" height="36" /> <a href="mailto:guilherme@gmtwebservices.com">guilherme@gmtwebservices.com</a></p>

<p><br />

</p>

</body>

</html>

Se contar tbm que não sei porque quando vou testar minhas páginas no meu localhost, se o dreamweaver esta aberto ele da um erro dizendo que o 'arquivo já esta em uso' dai preciso fechar o dreamweaver para que ele abra normalmenta a pagina com o BD.

 

Obrigado

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.