Microsoft KB Archive/191716

= BUG: Assigning Resultset to RDC Does Not Update Control(s) =

Article ID: 191716

Article Last Modified on 11/7/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q191716



SYMPTOMS
Opening a resultset in code and then assigning it to the Resultset property of the MSRDC (which is bound to a text box), will not populate the text box.



RESOLUTION
A workaround is to simply add another line of code immediately following "Set MSRDC1.ResultSet = rs" that specifically references the field desired for the text box. For example, Text1.DataField = "au_lname" would populate the first record into the text box as well as physically bind the RecordSet to the MSRDC. At this point, the MSRDC will have the full capability of scrolling through records.



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



Steps to Reproduce Behavior
 Create a Standard EXE Project in Visual Basic. Form1 is created by default. Go to Project/Components, and select the "Microsoft Remote Data Control 2.0." Go to Project/References, and select the "Microsoft Remote Data Object 2.0." Drop the MSRDC on the form as well as a TextBox and CommandButton. Set the following properties on the Text box:

DataSource: MSRDC1

DataField: au_lname  Paste the following code inside the Command_Click Event.

NoteYou must change UID and PWD to the correct values before you run this code. Make sure that UID has the appropriate permissions to perform this operation on the database. Dim cn As New rdoConnection Dim rs As rdoResultset cn.CursorDriver = rdUseOdbc cn.Connect = "dsn=pubs2;database=pubs;uid= ;pwd= " cn.EstablishConnection rdDriverNoPrompt, False Set rs = cn.OpenResultset("Select * from authors", rdOpenDynamic,     rdConcurValues, rdExecDirect) Set MSRDC1.Resultset = rs     'Text1.DataField = "au_lname"  'need this line of code to actually 'populate the text box.

</li> Run the application.</li></ol>

Additional query words: kbRDO200bug kbVBp600bug kbdse kbDSupport kbVBp

Keywords: kbbug kbpending KB191716

-

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

© Microsoft Corporation. All rights reserved.