title: "Could not convert variant of type (Null) into type (OleStr)" when using numbers in SQL query
body: <p>I am trying to check if a specific username exists within a database (Access) using SQL. If I use only letter or string characters the code works fine but when I use numbers as in the example below even though I insert them as a string I get the error:</p>
  
  <blockquote>
    <p>"Could not convert variant of type (Null) into type (OleStr)"  </p>
  </blockquote>
  
  <pre><code>  DataModule.Query.Active := False;
    sQuery := 'SELECT * FROM Login WHERE Username = "31"';
    DataModule.Query.SQL.Text := sQuery;
    DataModule.Query.Active := True;
  </code></pre>
  
  <p>I dont know what I'm doing wrong.</p>
  
  <p>edit:</p>
  
  <p>The debugger gives the error just after the if line in the following code</p>
  
  <pre><code> if UpperCase(DataModule.Query['Username']) = sUsername then
    begin
      if DataModule.Query['Password'] = sPassword then
      begin
        bPass := True;
      end
  </code></pre>
  
  <p>[Solved]</p>
  
  <p>Thank you all for the advice I got it working! </p>