I have a search a particular filename in my msaccess file .
if i search through ID no , i am able to fetch the output . but if i am searching by comparing filenames then i am getting error
Private Sub cmdSearch_Click()
Dim key As String, str As String
key = InputBox("Enter the Employee No whose details u want to know: ")
Set rs = Nothing
str = "select * from emp where Filename= &key " // my search query is //giving problems
rs.Open str, adoconn, adOpenForwardOnly, adLockReadOnly
txtNo.Text = rs(0)
txtName.Text = rs(1)
txtCity.Text = rs(2)
Set rs = Nothing
str = "select * from emp"
rs.Open str, adoconn, adOpenDynamic, adLockPessimistic
End Sub