Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 190410 - Last Review: March 2, 2005 - Revision: 2.2
PRB: Error Assigning Non-Opened Recordset to ADODC
This article was previously published under Q190410
When you attempt to set an ActiveX Data Objects (ADO) Data Control's
Recordset object to a previously dimensioned ADO Recordset the following
error is returned:
Run-time error '3704':
The operation requested by the application is not allowed if the object
is closed.
This error occurs when the recordset has not been opened yet.
The user may either open the recordset prior to assigning it to the ADO
Data Control (ADODC), or use the ADODC to create the recordset.
This behavior is by design.
Steps to Reproduce Behavior
- Open a Standard EXE Project in Visual Basic.
- From the Project\Component menu, select Microsoft ADO Data Control 6.0 (OLEDB).
- Place an ADODC on Form1.
- Add the following code to the form:
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
' Uncomment the below line to avoid error.
' rs.Open "Select * from authors", "DSN=Pubs", adOpenKeyset
Set Adodc1.Recordset = rs
End Sub
RESULTS: The error occurs.
APPLIES TO
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
| kbctrl kbdatabase kbdatabinding kbprb KB190410 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate