title: C++ Borland Builder 6 SQL Query
body: <p>I'm building an app in CppBB6 that reads/writes data from/in a database. From a table called Students I want to extract the Name of a student using the given Index number (both Name and Index are fields in table Student) and afterwards I want to put that Name in a String or AnsiString variable. </p>
  
  <p>I'm using this query to select the name:</p>
  
  <pre><code>AnsiString query;
  Query1-&gt;Close();
  Query1-&gt;UnPrepare();
  Query1-&gt;SQL-&gt;Clear();
  query="SELECT Name FROM Students where Index='" + Edit1-&gt;Text + "'";
  Query1-&gt;SQL-&gt;Add(query);
  Query1-&gt;Prepare();
  Query1-&gt;Open();
  </code></pre>
  
  <p>and it all checks out fine, but how do I put that Name in a variable? :/</p>