Click here to Skip to main content
14,734,606 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am creating a login form but it is not case sensitive. Please send help.

What I have tried:

Imports System.Data.OleDb
Imports System.Data


Public Class Login

Dim con As New OleDbConnection


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source = C:\Users\Jeoffer\Desktop\Attendance\Attendance.accdb"
con.Open()
Dim logincmd As OleDbCommand = New OleDbCommand("Select * from Login where [User]='" & TextBox1.Text & "') and [Pass]='" & TextBox2.Text & "'", con)
Dim loginrd As OleDbDataReader = logincmd.ExecuteReader

If (loginrd.Read() = True) Then

Form1.Show()
Me.Hide()
con.close()

Else
MsgBox("Login failed!", MsgBoxStyle.Exclamation)
con.Close()
Posted
Updated 29-Feb-20 0:07am

1 solution

You have far worse problems to resolve first; please read Solution 1 at https://www.codeproject.com/Questions/5260865/Problem-on-search-option-in-Csharp[^].

Once you have addressed that issue you need to fix your code to use proper hashed passwords, and not store them in clear text: see Password security[^].
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900