INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Microsoft VBScript runtime (0x800A01A8) Object Required:

Microsoft VBScript runtime (0x800A01A8) Object Required:

(OP)
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 --> vbscript

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.


RE: Microsoft VBScript runtime (0x800A01A8) Object Required:

(OP)
EDIT - I removed all the "exec" before the stored procedure names. The error still persists.

RE: Microsoft VBScript runtime (0x800A01A8) Object Required:

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

RE: Microsoft VBScript runtime (0x800A01A8) Object Required:

(OP)
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 --> vbscript

' 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 

RE: Microsoft VBScript runtime (0x800A01A8) Object Required:

(OP)
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 --> vbscript

arrDocs(i).LoadOnFly(DC.RecordSet) 

RE: Microsoft VBScript runtime (0x800A01A8) Object Required:

(OP)
Figured it out, thank you.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close