title: If Not RS.EOF and Not RS.BOF then written for ADODB versus current DAO format
body: <p>I currently have use of If Not RS.EOF and Not RS.BOF is a DAO Recordset, but I cannot use DAO in the new SQL backend environment. Code is as follows:</p>
  
  <pre class="lang-vbs prettyprint-override"><code>Function CloseSession()
  'This closes the open session
  
  Dim Rs As DAO.Recordset
  Set Rs = CurrentDb.OpenRecordset("SELECT * FROM Tbl_LoginSessions WHERE fldLoginKey =" &amp; LngLoginId)
  
  If Not Rs.EOF And Not Rs.BOF Then
      Rs.Edit
      Rs.Fields("fldLogoutEvent").Value = Now()
      Rs.Update
      Rs.Close
  End If
  
  Set Rs = CurrentDb.OpenRecordset("SELECT * FROM [Tbl_Users] WHERE PKUserID =" &amp; LngUserID)
  
  'Flag user as being logged out
      If Not Rs.EOF And Not Rs.BOF Then
          Rs.Edit
          Rs.Fields("fldLoggedIn").Value = 0
          Rs.Fields("FldComputer").Value = ""
          Rs.Update
          Rs.Close
      End If
  Set Rs = Nothing
  End Function
  </code></pre>
  
  <p>Essentially, I have started to write the code in ADODB.  However, upon researching If Not RS.EOF topic on the internet for ADODB, I was utterly unsuccessful. Does someone have knowledge on the utilization RS.EOF and RS.BOF that could be helpful in my plight to rewrite?</p>
  
  <pre class="lang-vbs prettyprint-override"><code>Function CloseSession()
  
  '/This closes the open session
  '/Define the OLE DB connection string.
  StrConnectionString = "DRIVER=SQL Server;SERVER=dbswd0027;UID=Mickey01;PWD=Mouse02;DATABASE=Regulatory;"
  
  '/Instantiate the Connection object and open a database connection.
  Set cnn = CreateObject("ADODB.Connection")
  cnn.Open StrConnectionString
  
  Dim strSQL1 As String
  Dim strSQL2 As String
  Dim StrLoginName As String
  Dim StrComputerName As String
  
  '/passing variables
  StrComputerName = FindComputerName
  strLoggedIn = "False"
  
  '/Declaring what table you are passing the variables to
   strSQL1 = "Update tTbl_LoginSessions SET fldLogoutEvent = '" &amp; Now() &amp; "'" &amp; _
   " WHERE fldLoginKey = " &amp; LngLoginId
  
  '/Declaring what table you are passing the variables to
   strSQL2 = "Update tTbl_LoginUsers SET fldLoggedIn = '" &amp; strLoggedIn &amp; "', fldComputer = '" &amp; StrComputerName &amp; "'" &amp; _
   " WHERE intCPIIUserID = " &amp; LngUserID
  
  cnn.Execute strSQL1, , adCmdText + adExecuteNoRecords
  cnn.Execute strSQL2, , adCmdText + adExecuteNoRecords
  '/close connections and clean up
  cnn.Close
  Set cnn = Nothing
  
  End Function
  </code></pre>