DOCUMENT:Q191716 24-AUG-1998 [vbwin] TITLE :BUG: Assigning Resultset to RDC Does Not Update Control(s) PRODUCT :Microsoft Visual Basic for Windows PROD/VER: OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Enterprise Edition for Windows, versions 5.0, 6.0 --------------------------------------------------------------------- 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. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- 1. Create a Standard EXE Project in Visual Basic. Form1 is created by default. 2. Go to Project/Components, and select the "Microsoft Remote Data Control 2.0." 3. Go to Project/References, and select the "Microsoft Remote Data Object 2.0." 4. Drop the MSRDC on the form as well as a TextBox and CommandButton. 5. Set the following properties on the Text box: DataSource: MSRDC1 DataField: au_lname 6. Paste the following code inside the Command_Click() Event: Dim cn As New rdoConnection Dim rs As rdoResultset cn.CursorDriver = rdUseOdbc cn.Connect = "dsn=pubs2;database=pubs;uid=sa;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. 7. Run the application. Additional query words: kbRDO200bug kbVBp600bug kbdse kbDSupport kbVBp ====================================================================== Platform : WINDOWS Issue type : kbbug Solution Type : kbpending ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.