title: VB6 ADO Set rs=command.Execute
body: <pre><code>Set rs = command.Execute 
  if not rs.EOF then
     'logic here
  end if
  </code></pre>
  
  <p>The above code fails at line 2, because rs is closed(probably the oledb provider figured out, wrongly, that it is an insert command so no need to return anything). The command is an insert statement something like:</p>
  
  <pre><code>Insert into log(Name,Value) values("xxx", 123); select scope_identity()
  </code></pre>
  
  <p>I need the identity back from the server in one roundtrip. Any ideas?</p>
  
  <p>PS: Updated insert statement with field names(thanks Eduardo), but that is not the problem.</p>