What does this Visual Basic 6.0 code below do? However it has been used for a search function, I'm not clear with it. So please explain what it does.
Private Sub cmdSearch_Click()
Dim key As Integer, str As String
key = InputBox("Enter the Employee No whose details u want to know: ")
Set rs = Nothing
str = "select * from emp where e_no=" & key
rs.Open str, adoconn, adOpenForwardOnly, adLockReadOnly
txtNo.Text = rs(0)
txtName.Text = rs(1)
txtCity.Text = rs(2)
txtDob.Text = rs(4)
txtPhone.Text = rs(3)
Set rs = Nothing
str = "select * from emp"
rs.Open str, adoconn, adOpenDynamic, adLockPessimistic
End Sub