brucelim80
Active member
- Joined
- Apr 20, 2006
- Messages
- 35
- Programming Experience
- Beginner
confused:
Hi All,
Can anyone help me on this? i am a newbie
I have an access database and i will like to execute an sql statement to search for the password of the username.
For example i got a username call bruce lim8 to search but it was not found on the database.
How do i write a code to search for the database and prompt the user if the username is not found in the database.
I have written a code below but it will leave blank if the record is not found.
Can anyone help me?
THANK YOU
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myData As New DataSet()
Dim myConnect As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\136.121.2.1\its helpdesk\CALLTRACK\ecall.mdb;")
myConnect.Open()
Dim strSelect As New OleDbCommand("SELECT * FROM useradmDB WHERE username='bruce lim7'", myConnect)
Dim reader As OleDbDataReader = strSelect.ExecuteReader
Do While reader.Read()
usrpswd.Text = reader.Item("password").ToString
Loop
End Sub
End Class
Hi All,
Can anyone help me on this? i am a newbie
I have an access database and i will like to execute an sql statement to search for the password of the username.
For example i got a username call bruce lim8 to search but it was not found on the database.
How do i write a code to search for the database and prompt the user if the username is not found in the database.
I have written a code below but it will leave blank if the record is not found.
Can anyone help me?
THANK YOU
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myData As New DataSet()
Dim myConnect As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\136.121.2.1\its helpdesk\CALLTRACK\ecall.mdb;")
myConnect.Open()
Dim strSelect As New OleDbCommand("SELECT * FROM useradmDB WHERE username='bruce lim7'", myConnect)
Dim reader As OleDbDataReader = strSelect.ExecuteReader
Do While reader.Read()
usrpswd.Text = reader.Item("password").ToString
Loop
End Sub
End Class