ASP

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentASP

Closed Thread
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 27th, 2007, 11:31 PM
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:

<%
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
Closed Thread

Viewing: Tutorialized ForumsWeb Design & DevelopmentASP > ASP Login Script


Developer Shed Advertisers and Affiliates


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 | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap