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 SkipVought 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

Status
Not open for further replies.
Oct 11, 2006
300
0
0
US
I have 2 divs in my page. I click on an employee and it passes that EmpID to that the below SQL and shows the list of reports in the 2nd div. When I test the SQL to see what is passing, I see that the query is working right and so is the querystring that is being passed.

But when I comment out the "Response.End"

and I click on an Employee, then I get an error at line 25 which is :

Code:
rsPlan.open planSQL, Conn

The error I get is:

ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/scripts/getReports.asp, line 25

My code is:
Code:
strEmp_ID = request.querystring("q")

	If strEmp_ID = "" Then
		strEmp_ID = strEmpID
	End If

	Dim rsPlan
	Set rsPlan = Server.CreateObject("ADODB.Recordset")

	Dim planSQL
	planSQL = "SELECT DISTINCT Report.PlanSetup, Report.Report, AMP.EmpID, AMP.DateOfPost " & _
		          "FROM Report INNER JOIN " & _
		          "PlanSetup ON Report.PlanSetup = PlanSetup.UniqueIdentifier INNER JOIN " & _
		          "AMP ON PlanSetup.DisplayName = AMP.PlanSetup " & _
		          "WHERE AMP.EmpID = " & strEmp_ID & " AND " & _
		          "AMP.DateOfPost IN (SELECT MAX(DateOfPost) FROM AMP WHERE EmpID = " & strEmp_ID & ") "

	Response.Write planSQL & "<br>"
	Response.Write strEmp_ID & "<br>"
	'Response.End

Any ideas why I am getting the error. Thanks.
 
i dont see Conn object being set

Set Conn = Server.CreateObject("ADODB.Connection")

-DNG
 
But I have an include at the very top of my page where the connection is set in the dbconnect.asp

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top