Link to home
Start Free TrialLog in
Avatar of interlaken
interlaken

asked on

Getting error Microsoft VBScript runtime error '800a01a8' Object required on asp page

Hi,

I have an asp page where i run reports based on the parameter passed to the db stored proc and report chosen.  It used to work fine until recently.  I added two more reports and added two more parameters in the stored proc. All the reports are running fine except for the first report in the list where I am getting this message at the bottom of my report page layout.

Microsoft VBScript runtime error '800a01a8'

Object required

/appfolder/reports-exec.asp, line 158
Avatar of alorentz
alorentz
Flag of United States of America image

What's the code on and around that line?
Avatar of McSqueeb
McSqueeb

check the spelling etc on line 157 & 158.

post the code??
Possible errors can be:

report file is missing
stored proceudre is missing

And Speeling mistakes are more common as pointed out by McSqueeb

Just like above :)
what is that u r using to create the report .. post some code ..
Open in notepad, scroll to line 156 to 158 and copy and paste :P

Object Required is a server component, typically an update component or mail component.

It would just be a case of then regsvr32'ing the DLL so your ASP Programs can use it
Particularly any Server.CreateObject("....that's really what we want to see
Avatar of interlaken

ASKER

Here is the code around that line

if rs.recordcount = 0 then
      Response.Write("<p>No Records Found</p>")
else
      If irptType = 1 then
            For y = 1 to 6
                  Response.Write("<table border=2><tr>")
                  for x = 0 to (rs.Fields.count - 1) step 1
                        Response.Write("<td>" & rs.Fields(x).name & "&nbsp;" & "</td>")
                  next
                  Response.Write("</tr>")
                  if rs.State = adStateClosed then
                        Response.Write("<tr><td>0</td></tr>")
                  else
                        while not rs.EOF
                              Response.Write("<tr>")            
                              for x = 0 to (rs.Fields.count - 1) step 1
                                    Response.Write("<td>" & rs.Fields(x).value & "&nbsp;" & "</td>")
                              next
                              Response.Write("</tr>")
                              rs.MoveNext
                        wend
                  end if
                  Response.Write("</table>")
                  if Y < 6 then  
      LINE 157****                  set rs = rs.NextRecordset
                        rs.movefirst
                  End if
            Next
      else
                  Response.Write("<table border=2><tr>")
                  for x = 0 to (rs.Fields.count - 1) step 1
                        Response.Write("<td>" & rs.Fields(x).name & "&nbsp;" & "</td>")
                  next
                  Response.Write("</tr>")
                  while not rs.EOF      
                        Response.Write("<tr>")            
                        for x = 0 to (rs.Fields.count - 1) step 1
                              Response.Write("<td>" & rs.Fields(x).value & "&nbsp;" & "</td>")
                        next
                        Response.Write("</tr>")
                        rs.MoveNext
                  wend
                  Response.Write("</table>")
      
      End If
      set rs=nothing
      set hoteldi = nothing      
end if
Take this out:

LINE 157****               set rs = rs.NextRecordset

This is bad news:  set rs = rs.NextRecordset

What are you trying to do?
I know, that was just added so you or someone else looking at my code would know where line 157 was.  It is not part of the code.
I didn't mean the LINE 157****  

I meant the  set rs = rs.NextRecordset

Take out the whole line
that's not it.  

Now I am getting this message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e18'

Rowset position cannot be restarted.

/appfolder/reports-exec.asp, line 158
That's because you're not opening your recordset for forward and backward movement.  Should be like this:

rs.open yourSQl, yourConn, 2, 3

Change to match and try again.
r u trying to retrive 2 recordsets using the same command object and callind one SP?? is that y u r using .NextRecordset .. if y, is ur cursor location = aduseclient?
all, the problem seems to be with my stored proc because when I switched back to the old sp, the error went away.  Please hold off your comments or suggestions for now and thank you for attending to this problem.
ok .. so basically ur SP was returning just one recordset and ur code was trying to move to the next recordset which was not present ...
I resolved this issue by changing the values for Y from 1 to 6 TO 1 to 4 for report type 1.
  If irptType = 1 then
          For y = 1 to 6

Please close this question.

Thank you to those who tried to help.
ASKER CERTIFIED SOLUTION
Avatar of RomMod
RomMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
RomMod,
y were the points refunded .. i had pointed the author to the problem he was facing .. it was his mistake that he was calling a different SP and so geting the error .. and i pointed him to that place ..

normally there would be a recommendation before refunding the points .. y is it not there in this case???
not really, I was not calling a different stored proc because there is only one stored proc I can make a call to.  His comments talked about using two record sets.  The sp returns a recordset based on the parameter value passed to the stored proc.  he can have the points but I don't think his comments helped me.  
interlaken,
when u were calling the wrong SP, i assume it is just returning back one recordset.. so basically ur code which does a .nextrecordset would fail and that is what i pointed out .. if u cannot accept the fact, i do not have any problem with it .. as for trying to be so generous of giving the points to me even when my comments did not help u "no thanks" .. it is not that the points given by u is going to help me to earn a livelihood or something like that .. i participate in EE not just for helping out but i get to learn too ... i have faced similar situations before in EE where the author is stubborn not to acknowledge that someone might have helped him out ....
wow wow wow, no need to get all huffy and puffy!  Like the other EE members, I come to EE to get help and nothing else.  I am greatfully thankful to those who have helped me in the past!  

I think you are having difficult time accepting the fact that your answer did not help me!  I have unlimited points, i don't care if you get them, whether you deserve them is a different story!

You say you have faced similar situation before, may be you need to face the fact that your recommendations always don't resolve people's issues.  

You say you come to EE to learn, Instead of wasting your time typying up comments in this question, why don't you try to help out someone else, that way you will learn more than wasting your time here typing.


thx for the advice .. as u said, i do feel that i am wasting my time here ..
my last comments in this thread here ...
ur problem - "Getting error Microsoft VBScript runtime error '800a01a8' Object required on asp page"
my comment - " r u trying to retrive 2 recordsets using the same command object and callind one SP?? "
ur answer - "I was not calling a different stored proc because there is only one stored proc I can make a call to.  His comments talked about using two record sets."

FYI, u can one SP which returns back more than one result and it can be retrived by a SINGLE recordset and to the access the other resultsets .. u use the command .NextRecordset .. as in this case the SP u were initially calling was retrning back just one recordset and so ur code "set rs = rs.NextRecordset" was failing and u were facing the error .. so by reducing the loop from 6 to 4 ensured that the number of recordsets been accessed is just 4 .. i never said i answered ur problem completely, but just pointed u to the right direction .. all EE out here appreciate efforts and the time spend by other EE to comment .. most of us r working and we take some time out of busy schedule ... looking at ur  profile, i think u lack experience in EE and so this immatuarity ..

anyway .. forget all that .. as for comments
>>You say you come to EE to learn, Instead of wasting your time typying up comments in this question, why don't you try to help out someone else, that way you will learn more than wasting your time here typing
Thx again for ur advice .. but if u had a taken look at my profile, u would have known that i have not wasted my time all the time .. there r some exceptional cases like u .. sorry that i even participated in this thread ... and i too have unlimited points here .. maybe i could donate some to u .. so that some other member might not have to face a similar situation ...
have a nice day ...