Can anyone tell me why my select statement is not case sensitve regarding the usrPassword=strPassword? Below are my codes:
Many thanks in advance.
Chong
Please help.Dim strUser, strPassword As String
Dim recLength, recCounter As Integer
Dim usrDataset As New DataSet()
strUser = txtUserName.Text
strPassword = txtPassword.Text
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\...\schUser.mdb;"
Dim cn As New OleDbConnection(strConn)
cn.Open()
Dim cmd As OleDbCommand = cn.CreateCommand()
Dim strSQL As String = "SELECT * FROM USERS WHERE usrName like " & "" & strUser & "" & " AND usrPassword=" & "" & strPassword & ""
cmd.CommandText = strSQL
Dim intRecordMatched As String = cmd.ExecuteScalar
If intRecordMatched <> Nothing Then
cn.Close()
Me.Close()
Exit Sub
Else
MsgBox("Incorrect Password or User Name", MsgBoxStyle.Critical)
End If
Many thanks in advance.
Chong