Simple ASP function question
- by J Harley
Good Morning,
I have got the following function:
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
And the following dbConnect:
SET databaseConnection = Server.CreateObject("ADODB.Connection")
databaseConnection.Open "Provider=SQLOLEDB; Data Source ="&dataSource&"; Initial Catalog ="&initialCatalog&"; User Id ="&userID&"; Password="&password&""
But for some reason I get the following error:
ADODB.Recordset error '800a0e78'
Operation is not allowed when the object is closed.
/UBS/DBMS/includes/blocks/block_databaseoverview.asp, line 30
Does anyone have any suggestions?
Many Thanks,
Joel