944,202 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 5460
  • ASP RSS
Oct 24th, 2005
0

login check

Expand Post »
i have database in which i hava login information iwa nted to check weather the persons login information is correct or wrong.
i m very new to asp. so any body help how i have to proceed

ASP Syntax (Toggle Plain Text)
  1. <%dim user,pass
  2. user=request.form("usercode")
  3. pass=request.form("pass")
  4. response.write(user)
  5. response.write(pass)
  6. ' Open database
  7. Dim Conn, RS
  8. Set Conn = Server.CreateObject("ADODB.Connection")
  9. Conn.Open "Driver={MySql ODBC 3.51 Driver}; Server=localhost; database=slogin; uid=user
  10.  
  11. ; pwd=pass option=3;"
  12. Set RS = Conn.Execute("SELECT * From userss where username='user' and password='pass'")
  13. if RS="user" then
  14. response.write("login")
  15. end if
  16. %>
i m trying some how like this but getting error. pls help
Last edited by Paladine; Oct 25th, 2005 at 12:28 pm. Reason: Adding Code blocks
Similar Threads
Reputation Points: 11
Solved Threads: 0
Junior Poster
aarya is offline Offline
139 posts
since Sep 2005
Oct 24th, 2005
0

Re: login check

what error message exactle are you getting? Also, your code is classic asp but you are posting in the asp .net forum.
Reputation Points: 14
Solved Threads: 19
Posting Pro in Training
campkev is offline Offline
484 posts
since Jul 2005
Oct 25th, 2005
0

Re: login check

Change your connection string to this format (with your application specific details of course)

ASP Syntax (Toggle Plain Text)
  1. oConn.Open "Provider=MySQLProv;" & _
  2. "Data Source=mySQLDB;" & _
  3. "User Id=myUsername;" & _
  4. "Password=myPassword"
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Oct 25th, 2005
0

Re: login check

Quote originally posted by Paladine ...
Change your connection string to this format (with your application specific details of course)

ASP Syntax (Toggle Plain Text)
  1. oConn.Open "Provider=MySQLProv;" & _
  2. "Data Source=mySQLDB;" & _
  3. "User Id=myUsername;" & _
  4. "Password=myPassword"

but i dont have any problem with my database connection.
i think problem with the login information check with database
Reputation Points: 11
Solved Threads: 0
Junior Poster
aarya is offline Offline
139 posts
since Sep 2005
Oct 25th, 2005
0

Re: login check

<%dim user,pass
user=request.form("usercode")
pass=request.form("pass")
response.write(user)
response.write(pass)
' Open database
Dim Conn, RS
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={MySql ODBC 3.51 Driver}; Server=localhost; database=slogin; uid=user; pwd=pass;

option=3;"
Set RS = Conn.Execute("SELECT * From userss where username='user' and password='pass'")
if RS.EOF then
response.write("not found")
else
response.write("u have loged in")
end if
' display results
'While Not RS.EOF
'Response.Write RS.Fields("userco") & "<br>"
'RS.MoveNext
'Wend
' closing connection
RS.Close
Conn.Close
Set RS = Nothing
Set Conn = Nothing%>


i m using thsi code if the login information is correct still it give sthe logininformation not found
Reputation Points: 11
Solved Threads: 0
Junior Poster
aarya is offline Offline
139 posts
since Sep 2005
Oct 25th, 2005
0

Re: login check

Change this select statment as : ("SELECT * From userss where username=" + user + "and password=" + pass)

Could be another thought. Remember, always test the SELECT statement as is outside the application to see if it returns what you are actually sending in.
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Oct 25th, 2005
0

Re: login check

thank u very much
Reputation Points: 11
Solved Threads: 0
Junior Poster
aarya is offline Offline
139 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Error while trying the update query
Next Thread in ASP Forum Timeline: register error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC