<%@LANGUAGE="VBSCRIPT"%> <!--#include file="Connections/dbnoticia.asp" --> <!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=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <% Dim login,senha login = Request.Form("login") senha = Request.Form("senha") %> <form action="login.asp"> <p>Login:</p><input type="text" name="login" size="20"><br> <p>Senha:</p><input type="password" name="senha" size="20"><br> <input type="submit" value="Entrar"> </form> </body> <% stringConexao = "dsn=noticia;uid=root;" Dim strnoticia Dim strnoticia_numRows Set strnoticia = Server.CreateObject("ADODB.Recordset") strnoticia.ActiveConnection = stringConexao strnoticia.Source = "SELECT * FROM login where usuario = '"&usuario&"' and senha = '"&senha&"' " strnoticia.CursorType = 0 strnoticia.CursorLocation = 3 strnoticia.LockType = 1 strnoticia.Open() strnoticia_numRows = 0 if strnoticia.eof then Response.Write("Usuário inexistente ou Usuário e Senha incorretos!") Session("Logado") = true Response.Redirect("principal.asp") else Response.Redirect("login.asp") end if %> </body> </html>
o codigo do BANCO DE DADOS E ESSE:
<% stringConexao = "dsn=noticia;uid=root;" Dim strnoticia Dim strnoticia_numRows Set strnoticia = Server.CreateObject("ADODB.Recordset") strnoticia.ActiveConnection = stringConexao strnoticia.Source = "SELECT * FROM login where usuario = '"&usuario&"' and senha = '"&senha&"' " strnoticia.CursorType = 0 strnoticia.CursorLocation = 3 strnoticia.LockType = 1 strnoticia.Open() strnoticia_numRows = 0 if strnoticia.eof then Response.Write("Usuário inexistente ou Usuário e Senha incorretos!") Session("Logado") = true Response.Redirect("principal.asp") else Response.Redirect("login.asp") end if %>
A LINHA QUE DA ERRO E A SEGUINTE:
[b][i]strnoticia.ActiveConnection = stringConexao[/i][/b]
aqui segue as informações do meu banco de dados
nome do banco de dados: dbluciano
nome da tabela : login
nome do campos: id_login
login
senha
alguem pode me ajuda?