hello all
i have a big problem with my system, can anyone help me plz
there`s some kind of error, there are 2 text box on my interface, 1 for entering an account number and one for entering password, there is a login button also.
here is the code when clicking on the button but it does not work!!! plz [code=vb]helpPrivate Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim connection As New OleDb.OleDbConn ection
Dim command As New OleDbCommand
Dim DataReader1 As OleDbDataReader
Dim selectall As String
Dim Account_No As String = txtAccount.Text
Dim Password As String = txtPassword.Tex t
connection = New OleDb.OleDbConn ection("Provide r=Microsoft.Jet .OLEDB.4.0; Datasource=db1. mdb")
selectall = "select * FROM Security WHERE A/c_number= " & Account_No & " and Password = " & Password & ""
command = New OleDbCommand(se lectall, connection)
connection.Open ()
DataReader1 = command.Execute Reader()
If DataReader1.Has Rows Then
MessageBox.Show ("ok")
Else
MessageBox.Show ("incorrect Account_No or password")
End If
End Sub
End Class[/code]
i have a big problem with my system, can anyone help me plz
there`s some kind of error, there are 2 text box on my interface, 1 for entering an account number and one for entering password, there is a login button also.
here is the code when clicking on the button but it does not work!!! plz [code=vb]helpPrivate Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim connection As New OleDb.OleDbConn ection
Dim command As New OleDbCommand
Dim DataReader1 As OleDbDataReader
Dim selectall As String
Dim Account_No As String = txtAccount.Text
Dim Password As String = txtPassword.Tex t
connection = New OleDb.OleDbConn ection("Provide r=Microsoft.Jet .OLEDB.4.0; Datasource=db1. mdb")
selectall = "select * FROM Security WHERE A/c_number= " & Account_No & " and Password = " & Password & ""
command = New OleDbCommand(se lectall, connection)
connection.Open ()
DataReader1 = command.Execute Reader()
If DataReader1.Has Rows Then
MessageBox.Show ("ok")
Else
MessageBox.Show ("incorrect Account_No or password")
End If
End Sub
End Class[/code]
Comment