Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB.Recordset error '800a0e7d' 1

Status
Not open for further replies.

gchaves

Programmer
Oct 27, 2003
105
US
HELP! I created two reports - one to pull # of leads submitted between two dates and another to pull # leads sold between two dates. Both were working yesterday...yet later that night (after not making any changes to the code or db), both stopped working and kept throwing the following error message:

ADODB.Recordset error '800a0e7d'

The connection cannot be used to perform this operation. It is either closed or invalid in this context.

/includes/reports/date_counts.asp, line 37

I have no problem connecting to the database (I can add, edit, list, delete, etc. with no problem), so I am not sure
why I'm getting this error? I'll list my queries below...am I using any reserved words that could be throwing my queries off?

Code:
Query 1 (get count of leads by date submitted)

			'create recordset object
			Set objRSDateSrchResults = Server.CreateObject("ADODB.Recordset")

			sqlDateSrchResults = "SELECT test_request.curDate, Count(test_request.bus_name) AS CountOfbus_name FROM test_request GROUP BY test_request.curDate HAVING (((test_request.curDate) BETWEEN #" & date1 & "# AND #" & date2 & "#));"
			
			'open the recordset
			objRSDateSrchResults.Open sqlDateSrchResults, objConn, 2, 3
Code:
Query 2 (sum the count of leads by the date range in above query)

			Set objRSDateCountResults = Server.CreateObject("ADODB.Recordset")

			sqlDateCountResults = "SELECT Count(test_request.bus_name) AS CountOfbus_name FROM test_request HAVING (((test_request.curDate) BETWEEN #" & date1 & "# AND #" & date2 & "#));"
			
			'open the recordset
			objRSDateCountResults.Open sqlDateCountResults, objConn, 2, 3


 
try using

sqlDateCountResults = "SELECT Count(test_request.bus_name) AS CountOfbus_name FROM test_request HAVING (((test_request.curDate) BETWEEN #" & date1 & "# AND #" & date2 & "#));"


set objRSDateCountResults = objconn.execute(sqlDateCountResults)
 
Thanks! I made that change and now am getting this error:

Microsoft VBScript runtime error '800a01a8'

Object required

/includes/reports/date_counts_sold.asp, line 35

Any suggestions?

Thanks,
G
 
thats because u need to use objConn instead of objconn as guitardave78 suggested...

-L
 
Also have you set the objConn to be a database connection (silly question i know)
set objConn=Server.CreateObject("ADODB.Connection")
objConn.Provider="Microsoft.Jet.OLEDB.4.0"
objConn.Open "c:/webdata/northwind.mdb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top