title: Simple ASP function question
body: <p>Good Morning, </p>
  
  <p>I have got the following function: </p>
  
  <pre><code> FUNCTION queryDatabaseCount(sqlStr)
          SET queryDatabaseCountRecordSet = databaseConnection.Execute(sqlStr) 
          If queryDatabaseCountRecordSet.EOF Then
              queryDatabaseCountRecordSet.Close
              queryDatabaseCount = 0
          Else
              QueryArray = queryDatabaseCountRecordSet.GetRows
              queryDatabaseCountRecordSet.Close
              queryDatabaseCount = UBound(QueryArray,2) + 1
          End If
      END FUNCTION
  </code></pre>
  
  <p>And the following dbConnect: </p>
  
  <pre><code>SET databaseConnection = Server.CreateObject("ADODB.Connection")
  
      databaseConnection.Open "Provider=SQLOLEDB; Data Source ="&amp;dataSource&amp;"; Initial Catalog ="&amp;initialCatalog&amp;"; User Id ="&amp;userID&amp;"; Password="&amp;password&amp;""
  </code></pre>
  
  <p>But for some reason I get the following error: </p>
  
  <pre><code>ADODB.Recordset error '800a0e78'
  </code></pre>
  
  <p>Operation is not allowed when the object is closed.</p>
  
  <p>/UBS/DBMS/includes/blocks/block_databaseoverview.asp, line 30</p>
  
  <p>Does anyone have any suggestions? </p>
  
  <p>Many Thanks, 
  Joel</p>