Dear Someone who can help me, This is not working.. It only shows the password textbox and the button.. <% Response.Expires = -1000 Response.Buffer = True Session("UserLoggedIn") = "" If Request.Form("login") = "true" Then CheckLogin Else ShowLogin End If Sub ShowLogin %> <body background="back.jpg"> <form name="login" id="login> <<h1><center> Company Name </center></h1> <h2><center> Project System </center></h2> <br/><br/><br/><p> <Center> Enter Username and Password </center> </p> <br/> <p><center> USER NAME <input type="text" name="username"> <br/><br/> PASSWORD <input type="password" name="pword"><br/><br/> <input type="submit" value="Login" > </center> </p> </form> </body> <% End Sub Sub CheckLogin Dim Conn, rs, sql set Conn = server.createobject("adodb.connection") Conn = "Provider=sqloledb;Data Source=datasource;" & _ "Initial Catalog=catalog;User Id=user;Password=password;" Set rs = Server.CreateObject( "ADODB.Recordset" ) sql = "SELECT * FROM CarInfo WHERE EmpID = '"&username&"'" Set rs = conn.execute(sql) rs.Open sql, Conn Session("UserLoggedIn") = "false" Do While Not rs.EOF If Request.form("username") = rs("EmpID") And Request.form("pword") = rs("Password") Then Session("UserLoggedIn") = "true" Exit Do End If rs.MoveNext Loop rs.Close Conn.Close If Session("UserLoggedIn") = "true" Then Response.Redirect "protectedpage.asp" Else Response.Write("Login Failed.<br><br>") ShowLogin End If End Sub %> Kindly help me.. I really need help. Thank you, Paula
You are trying to match the textbox content to a database, yes? Check the database connection string. It does not look you assigning correct string Conn = "Provider=sqloledb;Data Source=datasource;" & _ "Initial Catalog=catalog;User Id=user;Password=password;"
Hi.. thank you for your reply.. what is the right way to do that?.. I mean.. to connect my database?.. :l Thank you, Paula
Create a SQL DB from the control panel if you haven't done so. https://cp.Winhost.com/sites/mssqlmanager.aspx Once the database is created, restore your local SQL2005 to there. update your data source string to use the database you just created and restored.