title: Query returns only 4 out of 12 values of my table. Why is this happening?
body: <p>I have created a script which I am using on 2 different system. One is Windows 10 with SQL Server Express 2019 and the other is on Windows 7 (32bit) with SQL Server Express 2014. The db I am using has the same structure. The code I am using in ASP Classic is exactly the same on both machines! But in the win7 machine does not work as it should! </p>
  
  <p>I am having a query to my db and the problem is that SOME of the values I am getting are empty. The code I am using is the following:</p>
  
  <pre><code>        &lt;%
   Set rs21 = Server.CreateObject("ADODB.Recordset")
   strSQL21 = "SELECT * FROM otherfiles WHERE animalid LIKE '" &amp; lngRecordNo &amp; "'
   AND historyid LIKE '" &amp; historyid &amp; "' order by datedone DESC"
  
   rs21.Open strSQL21, adoCon
   %&gt;
   BLAH BLAH BLAH
   &lt;%
  Do While not rs21.EOF
  historyid = rs21("historyid")
  
  if not historyid = "" then
  Set rshis = Server.CreateObject("ADODB.Recordset")
  strSQLhis = "SELECT * FROM history WHERE id_no LIKE '" &amp; historyid &amp; "' order by id_no DESC"
  rshis.Open strSQLhis, adoCon
  
   '------------------- if I remove the following line (Set rscol) it works fine ---------------------------
  Set rscol = Server.CreateObject("ADODB.Recordset")
  strcol = "SELECT * FROM hospitals WHERE id_no = "&amp; rsGuestbook21("hosid") &amp;" order by id_no DESC"
  rscol.Open strcol, adocon
  color = rscol("color")
  %&gt;
  
       BLAH BLAH BLAH
  
      &lt;%=rs21("datedone")%&gt; ---&gt; empty value
      &lt;%=rs21("id_no")%&gt; ---&gt; works fine!!!
  </code></pre>
  
  <p>I am 100% sure that my table has its values. In fact as I mention above only but setting the <code>rscol = Server.CreateObject("ADODB.Recordset")</code> then the values becomes ??empty??. Commenting this line works fine. </p>