title: Trapping errors in TClientDataSet.CommandText
body: <p>I have a TClientDataSet connected to a TDataSetProvider, which in turn is connected to a TAdsQuery. I set the SQL command and then open the ClientDataset something like this:</p>
  
  <pre><code>try
    CDS.CommandText := 'SELECT * FROM tablename WHERE fieldname = 1';
    CDS.Open
  except
    // trap exception here - this never gets executed!
  end;
  </code></pre>
  
  <p>If the SQL statement in CommandText fails, however (syntax error or whatever) I get an exception within the Advantage code, but it never gets caught in my own exception handling code.</p>
  
  <p>Is there any way for me to trap this error and report it nicely to the user. Alternatively is there a way to verify the syntax of an SQL query before executing it?</p>
  
  <p>I'm using Delphi Pro 2009, and Advantage Local Server 9.</p>