| | |
login check
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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
i m trying some how like this but getting error. pls help
i m very new to asp. so any body help how i have to proceed
ASP Syntax (Toggle Plain Text)
<%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="user" then response.write("login") end if %>
Last edited by Paladine; Oct 25th, 2005 at 12:28 pm. Reason: Adding Code blocks
Change your connection string to this format (with your application specific details of course)
ASP Syntax (Toggle Plain Text)
oConn.Open "Provider=MySQLProv;" & _ "Data Source=mySQLDB;" & _ "User Id=myUsername;" & _ "Password=myPassword"
•
•
•
•
Originally Posted by Paladine
Change your connection string to this format (with your application specific details of course)
ASP Syntax (Toggle Plain Text)
oConn.Open "Provider=MySQLProv;" & _ "Data Source=mySQLDB;" & _ "User Id=myUsername;" & _ "Password=myPassword"
but i dont have any problem with my database connection.
i think problem with the login information check with database
<%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
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
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.
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.
![]() |
Similar Threads
- User login Check (ASP)
- urgent: session timeout occurs unexpectedly(given both web.config & global.asax code) (ASP.NET)
- no network connection ANYWHERE (Networking Hardware Configuration)
- Have I been activated? (Geeks' Lounge)
- Help with Forums. (PHP)
Other Threads in the ASP Forum
- Previous Thread: Error while trying the update query
- Next Thread: register error
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





