title: How do i set value to a variable ASP classic?
body: <p>Trying to get value from a DataBase and set to a variable, like this :</p>
  
  <pre><code>Dim prefferedAgencieUser
  Dim agenciePermission
  
  sSql = "SELECT ag.UserTeamLeader "
  sSQL = sSQL &amp;  " FROM dbo.BigAgencies ag "
  sSQL = sSQL &amp;  " inner join TCL01_cliente cl on cl.preferred_agency=ag.id "
  sSQL = sSQL &amp;  " where cl.Cod_cliente = '" &amp; nCodCliente &amp; "'"
  
  Set prefferedAgencieUser = oSelect.ExecuteQuery(sSql)
  
  if prefferedAgencieUser = UserName then
  agenciePermission = 1
  end if
  </code></pre>
  
  <p>The connection to the DB works well, but i got an error like:</p>
  
  <pre><code>Microsoft VBScript runtime error '800a000d'
  
  Type mismatch
  </code></pre>
  
  <p>What i doing wrong?</p>