Krypton
New member
- Joined
- Mar 16, 2008
- Messages
- 1
- Programming Experience
- Beginner
Hi everybody, I read some of the threads and you guys seem to know what you are doing. Maybe one of you can help me with the following problem?
I have a table in my access 2007 database that stores login details and I am trying to create a login form in Visual Studio. I have connected to the database but I am not sure about the code that compares the details the user puts into the textboxes to the details stored in the database.
This is what I have so far, if I understand correctly the compare method goes where it currently has *****
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objConnection As New OleDbConnection(strConnection)
objConnection.Open()
Dim strSQL As String = "SELECT * FROM tblAdmin"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objReader As OleDbDataReader
objReader = objCommand.ExecuteReader
If objConnection.State = ConnectionState.Open Then
If objReader.HasRows Then
if
******
End If
Else
MessageBox.Show("Error has occured", _
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End If
Thanks in advance
I have a table in my access 2007 database that stores login details and I am trying to create a login form in Visual Studio. I have connected to the database but I am not sure about the code that compares the details the user puts into the textboxes to the details stored in the database.
This is what I have so far, if I understand correctly the compare method goes where it currently has *****
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objConnection As New OleDbConnection(strConnection)
objConnection.Open()
Dim strSQL As String = "SELECT * FROM tblAdmin"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objReader As OleDbDataReader
objReader = objCommand.ExecuteReader
If objConnection.State = ConnectionState.Open Then
If objReader.HasRows Then
if
******
End If
Else
MessageBox.Show("Error has occured", _
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End If
Thanks in advance