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