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!

Microsoft VBScript runtime (0x800A01A8) Object Required:

Status
Not open for further replies.

d4tt4

Programmer
Aug 28, 2012
5
0
0
US
Hello all,

I'm currently building an intranet app and have run into this error when calling a method on my DataConnector class. The actual error line is in the Document.LoadSearchedDocs subroutine. Code is pasted below.

Code:
public sub LoadSearchedDocs(byRef arrDocs, byVal arrParams, byVal qString)
	dim i, sp, recCount, x(1) 'to pass to 0 parameter stored procedures
	DC  = new DataConnector
	DC.initialize
		
	'check qString for empty string
	if not qString = "" then
		'determine which stored procedure to call
		Select Case qString
			Case "t"
				' retrieve documents order by title
				sp = "exec spGetAllDocumentsByTitle"
			Case "f"
				' retrieve documents order by format
				sp = "exec spGetAllDocumentsByFormat"
			Case "d"
				' retrieve documents order by date
				sp = "exec spGetAllDocumentsByDate"
			Case "de"
				' retrieve documents order by department
				sp = "exec spGetAllDocumentsByDept"
			Case Else
		end Select
		
		'get number of records from stored procedure and dynamically allocate array
		DC.runStoredProc "spGetCountDocuments", x, true
		recCount = DC.RecordSet.Fields("recCount").value
		ReDim arrDocs(recCount)
		'call next stored procedure
		DC.runStoredProc sp, x, true
		
		'loop through records and load docs
		for i = 0 to UBound(arrDocs)
			arrDocs(i).LoadOnFly(DC.RecordSet)
		next
		else
		'run stored proc spGetDocumentsSearched which returns double result set
		'determine record count, dynamically allocate and load documents
		DC.runStoredProc "spGetDocumentsSearched", arrParams, true
		recCount = DC.RecordSet.Fields("recCount").value
		ReDim arrDocs(recCount)
		'move to next result set
		DC.RecordSet = DC.RecordSet.NextRecordset
		
                  'err.raise 1, "IsObject(DC.RecordSet): " & IsObject(DC.RecordSet)
		'loop through records and load docs
		for i = LBound(arrDocs) to UBound(arrDocs)
			arrDocs(i).LoadOnFly(DC.RecordSet) 'ERROR LINE
		next
	
	end if

The error is
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'DC.RecordSet'
/oasis/includes/classes/Document.asp, line 276

Line 276 is the line denoted in the code by my comment. The error (when uncommented) raised three lines above the actual error line produces the output:

IsObject(DC.RecordSet): True

I'm still turning my gears to figure out why DC.RecordSet isn't recognized as a valid object when the isobject function is returning true. There must be something else before this line that's affecting the situation. If anyone can spot the error it would be much appreciated. Please let me know if I can post any other code, perhaps the DataConnector class or the rest of the Document class. Again thank you.


 
EDIT - I removed all the "exec" before the stored procedure names. The error still persists.
 
try using SET, like this:

Code:
Set DC.RecordSet = DC.RecordSet.NextRecordset

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Thank you for your input

When I use set I get this error:

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'RecordSet'
/oasis/includes/classes/Document.asp, line 272

I have set built into my properties in the DataConnector class.

Code:
         ' read the current recordset value
	public property get RecordSet()
		set RecordSet = mRecordSet
	end property
		
	'store a new recordset value
	public property let RecordSet(pData)
		set mRecordSet = pData
	end property
 
If another path is taken through the function, the error also occurs on the line above where I commented that reads the same way.

Code:
arrDocs(i).LoadOnFly(DC.RecordSet)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top