Just use TDataSet.Locate. In all of the below, I'm using ds to represent your TDataSet variable.
UserName := EditUserName.Text;
Password := EditPassword.Text;
if ds.Locate(UserName, ['UserNameField']) then
begin
if ds.FieldByName('Password').AsString = Password then
// Passwords match
else
// Passwords don't match
end
else
// User name not found
To move from one record (row) to the next, simply use ds.Next;, and to move to the one before use ds.Prior;. To go to the first row, use ds.First, and ds.Last to go to the last one.
This is really basic database programming. You should probably search for a tutorial that explains it and work through it.
SELECT COUNT(*) FROM USERTABLE WHERE <username>=:param1 and <password>=:param2statement - instead of navigating through a dataset