title: How do I use a SELECT SQLite statement and output the data as a string?
body: <p>Okay so I know how to put data into an SQLite database... But how do I go about returning the value?</p>
  
  <p>Adding data into the database using <code>TSQLQuery</code>, which works:</p>
  
  <pre><code>procedure TForm2.Button2Click(Sender: TObject);
  var
    noteTitle : string;
  begin
    try
      form1.SQLQueryInsert.ParamByName('title').AsString := edit1.Text;
      form1.SQLQueryInsert.ParamByName('content').AsString := memo1.Text;
      form1.SQLQueryInsert.ExecSQL(); // INSERT INTO notes (id, title, content) VALUES (:id, :title, :content)
      form1.notes.Refresh;
      form2.Edit1.Text := '';
      form2.Memo1.Text := '';
      form2.close;
      form1.Show;
    except
      on e: Exception do
      begin
        ShowMessage(e.Message);
      end;
    end;
  end;
  </code></pre>
  
  <p>Now in the process to try and accomplish reading from the table, I've made the assumption it's something similar like:</p>
  
  <pre><code>procedure TForm1.ListView1DblClick(Sender: TObject);
  var
    results : TDataSet;
  begin
    if ListView1.Selected &lt;&gt; nil then
    begin
      form3.show();
      SQLQuerySelectTitle.ParamByName('title').AsString := ListView1.Selected.Text;
      SQLQuerySelectTitle.ExecSQL(); //SELECT title FROM notes WHERE title = :title
      form3.memo1.Text := SQLQuerySelectTitle.Fields[0].ToString;
    end;
  end;
  </code></pre>
  
  <p>but so far, it just returns list out of bounds error.</p>
  
  <p>Thank you, I could really use some help understanding this, I've tried looking for some information on it but no luck.</p>