hi, i have created a program that allows users to add a username and password as well as details about themselves to give them access to my programme.
All the usernames are stored in a database file and although when i first created the programme everything seemed fine it turned out that for some reason it is not recognising some of the usernames in the record so far it is only picking up usernames 1,2 and 4 out of 5. i have no idea why and it is quite frustating as i thought it was working.
anyway below is a copy of the code used to do this please if anyone can help i will be forever grateful =-)
Public Attempts As Integer
Public I As Integer
Private Sub cmdEnter_Click()
'original source for database as in college =N:\AVCE IT\Unit .programming\assigment\Prog.mdb
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\College WORK\Programming work\prog.mdb;Jet OLEDB

atabase Password=1234", adOpenDynamic
Set rs = CreateObject("ADODB.Recordset")
StrSQL = "SELECT DISTINCT * FROM tblUsers ORDER BY UserID ASC"
rs.Open StrSQL, cn, adOpenDynamic
I = 0
Do While Not rs.EOF
If txtPassword.Text = rs("Password") And txtUserName.Text = rs("UserName") Then
MsgBox "Welcome " & rs("FirstName") & " " & rs("LastName"), 64, "Welcome to the games quiz"
Unload frmPass
frmwelcome.Show
Exit Sub
Else
I = I + 1
rs.Move (I)
End If
Loop
Attempts = Attempts - 1
MsgBox "Sorry the username or password you entered was invalid", 16, "Access Denied"
txtUserName.SetFocus
lblAttempts = "You have " & Attempts & " attempts remaining"
If Attempts = 0 Then
End
End If
End Sub