title: how to query access database and retrieve values based on some criteria's from excel vba
body: <p>Can you please help with access database queries from excel vba</p>
  
  <p>My algorithm is as follows:</p>
  
  <hr>
  
  <p>Open connection to access database</p>
  
  <p>Select  table1.column1, table1.column2, table1.column3 where table1.column3.value = “x” and table1.column2.value = “y”</p>
  
  <p>Switch Case 1: If <strong>no records found matching the criteria</strong> from access database</p>
  
  <p>Insert some values etc…</p>
  
  <p>Switch Case 2 : If <strong>records found matching the criteria</strong> from access database</p>
  
  <p>No action needed</p>
  
  <p>Switch Case 3 : If <strong>records found not matching the criteria</strong> values from access database</p>
  
  <p>Should display the values in an datagridview in excel vba</p>
  
  <p>Should not allow to insert values</p>
  
  <hr>
  
  <p>Kindly help me with the code needed from excel vba</p>
  
  <p>Thanks
  Prabu M</p>