Here is the code first off all for the login script (HTML)
<form id="form1" runat="server" method="post">
<asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
<asp:TextBox ID="txtPassword"
runat="server" style="width: 128px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Login" />
Here is the behind code to that page double click on the button and get this code (VB.NET)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("database\UsersPasswords.mdb"))
Try
Dim query As New OleDbCommand("SELECT COUNT(*) AS Result, Username AS UsernameInput, [Password] AS PasswordInput FROM(UsersPasswords)GROUP BY Username, [Password]HAVING (COUNT(*) = 1) AND (Username = '" & txtUsername.Text & "') AND ([Password] = '" & txtPassword.Text & "')", conn)
conn.Open()
Dim datareader As OleDbDataReader = query.ExecuteReader()
datareader.Read()
If datareader.Read = True Then
Label1.Text = ("You are logged in")
Else
Label1.Text = ("Wrong Username or Password")
End If
conn.Close()
Catch ex As Exception
Label1.Text = (ex.Message)
End Try
End Sub
The problem is that when i type in the correct username and password from the database it just keeps saying "wrong password" ive tried a number of diffrent querys but im unable to fix it :(
Thanks for your help!