title: Expected end of statement error
body: <p>I have this VB script that is being ran inside a 3rd party app and is throwing the "Expected End of Statement' Error. Here is the code in question. The select statment works fine in SQL server manager studio. </p>
  
  <p>Thanks.</p>
  
  <pre><code>Dim SecurityDB
  Set SecurityDB = CreateObject("ADODB.Connection")
  Conn = "DRIVER={SQL Server};SERVER=ustcca015s6\Continuum;DATABASE=continuumdb;UID=Andy8796;PWD=xxxx1234;"
  SecurityDB.Open Conn
  Set EmployeeRS = SecurityDB.Execute "Select count(*) from dbo.personnel where state=1 and lastname not like 'lapt%' and lastname is not NULL and valuelo in (Select ObjectIdLo from area where uiname like 'usmm%' and uiname not like '%gate%') and valuelo &lt;&gt; 1111497912;"
  Result = EmployeeRS.GetRows
  EmployeeRS.Close
  SecurityDB.Close
  </code></pre>