BUG: ADO Error 800a0cc1 Using SetSQLText Or SetRecordSource

ID: Q190589


The information in this article applies to:


SYMPTOMS

Attempting to use setSQLText() or setRecordSource() on a recordset that is bound to a stored procedure gives the following ActiveX Data Objects (ADO) error:

ADODB.Parameters error '800a0cc1'

ADO could not find the object in the collection corresponding to the name or ordinal reference requested by the application.

/kb/_ScriptLibrary/Recordset.ASP, line 456


CAUSE

The recordset sets its parameters before opening the recordset. Even though the database object has changed, the routine that sets the parameters is still called.


RESOLUTION

There are two workarounds for this:

In a DHTML page, setting the parameter programmatically will not work. Consider using two recordset DTCs.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a project with a data connection.


  2. Add a page.


  3. Add a recordset to the page.


  4. Bind the recordset to a stored procedure that takes parameters.


  5. Set the parameters in the Parameters tab.


  6. Use either setSQLText() or setRecordSource() to change the record source as in this example:
    
    If Recordset1.isOpen() then Recordset1.close()
    Recordset1.setSQLText("SELECT * FROM employee")
    Recordset1.open 


Additional query words:


Keywords          : kbADO kbVisID kbVisID600bug kbGrpASP 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: May 13, 1999