title: Convert variant of type (Dispatch)
body: <p>I am trying to use Delphi 7 / ADO to read the lastLogonTimeStamp field in AD for each user. My loop can read the fields required. The string fields are easy to use, but I have failed to decode the timestamp. It is of type Variant and vartype returns 9 (Dispatch)</p>
  
  <p>I've tried various typecasts, including INT64 (which I believe is how the timestamp is stored), and varToStr. All the records are vartype 9 except one which is vartype 1 probably because it is empty.</p>
  
  <pre><code>ADOQuery1: TADOQuery;
  ADOQuery1SN: TWideStringField;
  ADOQuery1CN: TWideStringField;
  ADOQuery1AdsPath: TWideStringField;
  ADOQuery1lastLogonTimestamp: TVariantField;
  logonfield : variant;
  
      logonfield := ADOQuery1lastLogonTimestamp.value;
      stringgrid1.Cells[1,i] :=  vartostr(logonfield);
  </code></pre>
  
  <p>I want to get date of last logon for each user, with exceptions filtered by the program. I can get the string fields OK. But I get:</p>
  
  <p>Error: could not convert type (dispatch) into type (string) 
  [or anything else I tried! TDateTime, INT64 ...]</p>