title: VBA: Validate SQL Code
body: <p>Is it possible to validate a SQL code on syntax correctness with VBA?</p>
  
  <p>In my scenario, the user is entering a SQL Statement into a text box of a user form. I would first like to validate if the SQL statement is correct syntax wise, and second check if it's a SELECT statement.</p>
  
  <p><strong>What the validation shall check</strong></p>
  
  <ul>
  <li>Are the SQL keywords (which can be used in a SELECT statement) spelled correct</li>
  <li>Order of SQL keywords</li>
  <li>Is the statement a SELECT statement</li>
  </ul>
  
  <p><strong>Summarizing the comments</strong></p>
  
  <ul>
  <li>The RDBMS is Oracle</li>
  <li>The Excel sheet does not have a connection to the Oracle database. </li>
  <li>The Excel sheet will be uploaded to a system, then the SQL codes will be executed on the database.</li>
  <li>I am aware of the possibility of SQL injection.</li>
  <li>The provided SQL statement shall be checked on syntax correctness. Column names shall not be checked, as database structure is not known.</li>
  </ul>