PRB: Run-time Bound Server-side ADO Recordset Skips Second Record (244801)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.01
- ActiveX Data Objects (ADO) 2.1
- ActiveX Data Objects (ADO) 2.1 SP1
- ActiveX Data Objects (ADO) 2.1 SP2
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- ActiveX Data Objects (ADO) 2.7
This article was previously published under Q244801 SYMPTOMS
When using a recordset with a server-side forward-only, or dynamic cursor and binding to a textbox at run-time it is possible for the recordset to skip the second record. The textbox will initially display the first record. A MoveNext causes it to display the third record. With the dynamic cursor, a MovePrevious will then display the second record correctly. This behavior is only exhibited immediately after binding or after a ReQuery. This behavior is also shown if the textbox is bound from the Data Environment.
RESOLUTION
The recordset can be displayed correctly by reading one of the fields prior to binding to the text box. For a run-time bound control, use the following code prior to binding the textbox.
Dim strTemp as String
strTemp = rs(0) 'rs is the Recordset
When using the Data Environment, the only way around this problem is to bind the textbox at run-time and use the workaround earlier. When you want to call the ReQuery method, you should re-bind the recordset. The following code shows the workaround with ReQuery.
rs.ReQuery
Dim strTemp as String
strTemp = rs(0)
Set Text1.DataSource = rs
Modification Type: | Major | Last Reviewed: | 8/23/2001 |
---|
Keywords: | kbDataBinding kbDataEnv kbDSupport kbprb KB244801 |
---|
|