Microsoft KB Archive/300387

= BUG: DataReport Does Not Show First Record with Server-Side Forward-Only Cursor =

Article ID: 300387

Article Last Modified on 6/13/2001

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Professional Edition

-



This article was previously published under Q300387



SYMPTOMS
When a Visual Basic DataReport object is bound to an ActiveX Data Objects (ADO) Recordset object whose CursorLocation property is set to adUseServer and whose CursorType property is set to adOpenForwardOnly, the DataReport does not display the first record in the recordset, even though the record is present.



RESOLUTION
To resolve this problem, specify a client-side ADO cursor (&quot;CursorLocation = adUseClient&quot;), or specify a server-side CursorType other than the adOpenForwardOnly enumeration.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
Because a server-side, forward-only cursor is the ADO default and not the default for a DataEnvironmentCommand object, this problem is more likely to occur when the DataReport is bound to an ADO recordset that has been opened in code. However, you can use the DataEnvironment to easily reproduce this problem.

Steps to Reproduce Behavior
 Create a new Data project in Visual Basic. Open the DataEnvironment designer, and configure the default connection to connect to an available Microsoft SQL Server and its Northwind database. Add a command under the connection. On the General tab, select the CustOrdersOrders stored procedure. On the Parameters tab, type ALFKI as the value for the CustomerID input parameter. On the Advanced tab, set the CursorLocation to 2 - Use server-side cursors and the CursorType to 0 - Forward-only. Close the Properties dialog box. Click to expand the field list under the Command object. Open the DataReport designer, and drag the OrderID field from the field list under the Command object to the detail section of the DataReport.</li> Specify DataEnvironment1 as the DataSource for the DataReport, and Command1 as its DataMember.</li>  Open the project's Form, &quot;frmDataEnv&quot;, and add a command button. In the command button's Click event procedure, add the following code: DataReport1.Show </li> Run the project, and click the command button to display the DataReport. Notice that the first displayed order number is 10692 and that the first order for customer ALFKI, number 10643, is missing.</li> End the project, and return to the Advanced tab of the DataEnvironment Command Properties dialog box. Change the CursorLocation to 3 - Use client-side cursors. This also changes the CursorType to 3 - Static.</li> Run the project again, and click the command button to display the DataReport. Notice that the first displayed order number is now 10643, which is the first order for customer ALFKI.</li></ol>

Additional query words: datareport

Keywords: kbbug kbnofix kbdatabase kbreportwriter KB300387

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.