title: VB.Net Select-Like query in MS Access not working
body: <p>I need to show the data from the column 'Purchaser' starting with the text entered in the textbox 'Purchaser' on the form. I am using MS Access 2003 database.
  For this I am using the following...</p>
  
  <pre><code>            Dim query = "SELECT * FROM Details WHERE [Purchaser] LIKE '" &amp; Purchaser.Text &amp; "*'"
              Dim dc = New OleDbCommand(query, cn)
              Dim rows = dc.ExecuteNonQuery
              cn.Close()
  
              If rows = 0 Then
                  'Show a form for new entry
              Else
  
                  Dim oleadap = New OleDbDataAdapter(query, cn)
                  Dim dset As DataSet = Nothing
                  oleadap.Fill(dset, "Details")
  
                  For i = 0 To rows
                      Dim purName = dset.Tables("Details").Rows(i).Item("Purchaser").ToString
                      Dim purAddr = dset.Tables("Details").Rows(i).Item("Address").ToString
  
                      'Populate a list
  
                  Next
  
              End If
  </code></pre>
  
  <p>The variable 'rows' always turns out to be zero even if I check for a Purchaser starting with, say A, in the database.</p>