title: SQL cursor error
body: <p>I have been using the notepad SQLhelper (notesDBadapter) as a model, some of it works, some doesn't. I can get a cursor for 'fetchallrecords() but it crashes if I try a call passing an argument and using the 'WHERE'. The argument is passed but the cursor fails. My code in activity;</p>
  
  <pre><code>    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.listselectedfile);    
  
      //Button ID clicked in previous activity
      Bundle bundle = getIntent().getExtras();
      int BtnId = bundle.getInt("ButtonID");
      Toast.makeText(this, "ButtonID selected in Main:= " + BtnId, Toast.LENGTH_LONG) .show(); 
  
      mDbHelper = new SectionsDbAdapter(this);
      mDbHelper.open();
      fillData();
  
  }  
      private void fillData() {
          // Get all of the notes from the database and create the item list
          //Cursor c = mDbHelper.fetchAllRecords();       &lt;=== works fine
          Cursor c = mDbHelper.fetchRecordsbySource("UK"); &lt;=== fails in DBhelper
          startManagingCursor(c);
  
          String[] from = new String[] { SectionsDbAdapter.KEY_DESC };
          //String[] from = new String[] { SectionsDbAdapter.KEY_SOURCE }; &lt;=== can fetch this column from table
          int[] to = new int[] { R.id.tv_full_width };  //the R.id.xxx= view in the .xml file
  
          // Now create an array adapter and set it to display using our row
          SimpleCursorAdapter records =
              new SimpleCursorAdapter(this, R.layout.section_row_full_width, c, from, to);  //the .xml file containing the R.id.xxxx
          setListAdapter(records);
      }
  </code></pre>
  
  <p>In the DBhelper;
  This call works and returns the full table;</p>
  
  <pre><code>    public Cursor fetchAllRecords() {
  
      return mDb.query(DATABASE_TABLE, new String[] {
      KEY_ROWID, KEY_DESC, KEY_DEPTH, KEY_TWEB, 
      KEY_BF1, KEY_TF1, KEY_BF2, KEY_TF2, 
      KEY_IMAJOR, KEY_IMINOR, 
      KEY_PLMAJOR, KEY_PLMINOR, 
      KEY_JTORSION, KEY_AREA,  
      KEY_WARPING, KEY_CYCHANNEL, 
      KEY_SHAPE, KEY_SOURCE, 
      KEY_UNITS},null, null, null, null, null);
  }
  </code></pre>
  
  <p>This call fails on the cursor (the argument is passed successfully);</p>
  
  <pre><code>    public Cursor fetchRecordsbySource(String source) throws SQLException {
      Log.v("In fetchRecordsbySource", "source = " +source);      
  
      Cursor mCursor = mDb.query(true, DATABASE_TABLE, new String[] {
      KEY_ROWID, KEY_DESC}, KEY_SOURCE + " = " + source, null, null, null, null, null);
      if (mCursor != null) {
          mCursor.moveToFirst();
      }
      return mCursor;
  }
  </code></pre>
  
  <p>There is nothing obvious to me in the Eclipse debug, but, as a newby, I probably have not got the necessary perspective.</p>
  
  <p>Can anyone spot the error?</p>