# [web] [ASP/SQL] Bug with query

## Recommended Posts

chbrules    170
I believe I have this right, I just keep getting an error I can't pinpoint because it just doesn't make sense. Basically I'm just running a query to grab some values from a column. Here's what I've gotten:
sConn = "Provider=SQLOLEDB;SERVER=zurich;Database=Compulink;UID=id;pwd=pass"
strQ = "SELECT [departmentid] FROM [EnduserDepartment] WHERE [companyid] = '" & companyID & "'"
checker.Open strQ, sConn
And I get this error about the check.Open line:
ADODB.Recordset error '800a0e79'

Operation is not allowed when the object is open.

/sst/setup/CompanyDept.asp, line 31

How can it be open when it's the first instance of the object I use to open the query with!? That's what trips me up. I don't see how that error helps me since an open query object isn't that actual case.

##### Share on other sites
chbrules    170
nm got it. I forgot to close it in my while loop. >_>