BUG: WillChangeRecordset Event Not ExecutedID: Q191455
|
When the Close method of an ActiveX Data Objects (ADO) RecordSet object is called, the WillChangeRecordset event does not fire. The documentation states, in error, that this event fires when closing the RecordSet.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
Dim WithEvents rst As ADODB.Recordset
Dim cn As New ADODB.Connection
Private Sub Form_Load()
With cn
.CursorLocation = adUseClient
.Open "dsn=pubs;uid=sa;pwd=;"
End With
Set rst = cn.Execute("Select * from Authors", , adOpenKeyset)
Set Text1.DataSource = rst
Text1.DataField = "au_lname"
End Sub
Private Sub rst_WillChangeRecordset(ByVal adReason As _
ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset)
Debug.Print "ADO WillChangeRecordset"
End Sub
Private Sub Command1_Click()
Debug.Print "About to Close"
rst.Close
Debug.Print "Close complete"
Unload Me
End Sub
For additional information about ActiveX Data Objects (ADO) events, please
refer to the Data Access Software Development Kit (DASDK), Microsoft Data
Access Components (MDAC) or the Visual Studio 6.0 documentation.
For the latest ActiveX Data Objects (ADO) information and updates please
see the following URL:
http://www.microsoft.com/data/
Additional query words: kbdocerr kbADO200bug kbdse kbcode
Keywords :
Version : WINDOWS:2.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: February 9, 1999