ASP
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsWeb Design & DevelopmentASP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old May 28th, 2007, 12:32 AM
Pyroboy1080 Pyroboy1080 is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 6 Pyroboy1080 New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 29 m 41 sec
Reputation Power: 0
ASP Login Script

I have been working on this script for logging into my website for quite some time now, and can't seem to get it working right. If anyone can help, I'd greatly appreciate it. Alright, the code is listed below:
Code:
   <%
   username = Request.Form("username")
   password = Request.Form("password")

   Dim Conn, RS

   Set Conn = Server.CreateObject("ADODB.Connection")
   Set RS = Server.CreateObject("ADODB.Recordset") 
   DSNStatement = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
   DSNStatement = DSNStatement & Server.MapPath("Login.mdb")
   Conn.Open DSNStatement

   SQLStatement = "SELECT * FROM Login1 WHERE Username = '" & username & "' AND Password = '" & password & "' "
   RS.Open SQLStatement, Conn, 3, 3

   RS.MoveFirst

   If Not RS.EOF Then
   Do Until RS.EOF
   RS.MoveNext

   user_Name = RS.Fields("Username").Value
   pass_Word = RS.Fields( "Password" ).Value

   If ( user_Name = username ) Then
      If( "password = pass_Word" ) Then
      Session("username") = username
      response.redirect( "(you have logged in page, edited out for security purposes)" )
      Else
      response.write(  "incorrect password" )
      End if
   Else
   response.write( "incorrect username" )
   End if
   Loop 

   else 
   response.write "No matches." 
   end if

   RS.close
   Conn.close 
   %>

The connection always fails, and if i use on error resume next, it only gives "Incorrect Username."

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentASP > ASP Login Script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT