You'll need to put single quotes around the search string:
If OptfindCD = True Then
SqlStmt = "SELECT [CD Name], [Path], [File Name] from [CD Explorer] where [CD Name] = '" + txtsearch.Text + "'"
ElseIf optfindfile = True Then
SqlStmt = "SELECT [CD Name], [Path], [File Name] from [CD Explorer] where [File Name] = '" + txtsearch.Text + "'"
End If
If OptfindCD = True Then
SqlStmt = "SELECT [CD Name], [Path], [File Name] from [CD Explorer] where [CD Name] = '" + txtsearch.Text + "'"
ElseIf optfindfile = True Then
SqlStmt = "SELECT [CD Name], [Path], [File Name] from [CD Explorer] where [File Name] = '" + txtsearch.Text + "'"
End If