Microsoft KB Archive/246919

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 16:13, 18 July 2020 by 3155ffGd (talk | contribs) (importing KB archive)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


Article ID: 246919

Article Last Modified on 8/7/2007



APPLIES TO

  • Microsoft Visual Basic 6.0 Enterprise Edition



This article was previously published under Q246919

SYMPTOMS

Visual Basic crashes when running a Standard EXE project that contains an ADO Data Control and a UserControl that has DataGrid or MSHFlexGrid controls if the UserControl code was generated by the ActiveX Control Interface Wizard.

The crash occurs on the call to the ReadProperty() method of the PropertyBag object in the UserControl's ReadProperties event:

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    'Crashes on the following line:
    Set DataSource = PropBag.ReadProperty("DataSource", Nothing)
End Sub
                

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed


To download the latest Visual Studio service pack, visit the following Microsoft Web site:

MORE INFORMATION

Steps to Reproduce Behavior

  1. In Visual Basic, create a new ActiveX Control project. Project1 is created by default. UserControl1 is added to Project1 by default.
  2. From the Project menu, click to select References. From the list of available References, click to select Microsoft Data Source Interfaces.
  3. From the Project menu, click to select Components. From the list of available Components, select Microsoft DataGrid Control 6.0 (OLE DB).
  4. Add a DataGrid control to UserControl1's Design window. DataGrid1 is added by default.
  5. If the ActiveX Control Interface Wizard is not listed on the Add-Ins menu, do the following:
    1. From the Add-Ins menu, select Add-In Manager.
    2. From the list of available Add-Ins, select VB6 ActiveX Ctrl Interface Wizard.
    3. Check the Loaded/Unloaded checkbox, and then click OK.
  6. From the Add-Ins menu, click to select ActiveX Control Interface Wizard.
    1. At the Introduction screen (if displayed), click Next.
    2. At the Select Interface Member dialog box:
      1. Move all pre-selected properties to the list box on the left.Move only the DataSource property to the right, so that it is the only Property listed in Selected names.Click Next.
      2. Move only the DataSource property to the right, so that it is the only Property listed in Selected names.Click Next.
      3. Click Next.


    3. At the Create Custom Interface Members screen, click Next.
    4. In the Maps To section of the Set Mapping screen:
      1. Select DataGrid1 from the Control drop-down list.Select DataSource from the Member drop-down list.Click Next.
      2. Select DataSource from the Member drop-down list.Click Next.
      3. Click Next.


    5. In the Finished! screen, deselect View Summary Report, and then click Finish.
  7. Save and compile the UserControl. Close the UserControl1 Design window.
  8. From the File menu, select Add Project to add a Standard EXE project. Project2 is created by default. Form1 is added to Project2 by default.
  9. From the Project menu, click to select Components. From the list of available Components, select Microsoft ADO Data Control 6.0 (OLE DB).
  10. Place an ADO Data Control onto Form1. ADODC1 is created by default.
    1. Set the ConnectionString property of the ADO Data Control to connect to the Nwind database that comes with Visual Basic. Connect by using either ODBC or the Jet OLE DB Provider.
    2. Set the RecordSource property of the ADO Data Control to the Customers Table.
  11. Place an instance of the UserControl onto Form1. UserControl1 is created by default. Set the DataSource property of UserControl1 to ADODC1, the ADO Data Control.
  12. In the Project Group in Project Explorer, set Project2 as the Start Up Project.
  13. Press function key F8 to Step Into the Project2's code, and note that Visual Basic crashes under the UserControl1_ReadProperties event:

    Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
        'Crashes on the following line:
        Set DataSource = PropBag.ReadProperty("DataSource", Nothing)
    End Sub
                        



Additional query words: sp4

Keywords: kbaddin kbbug kbctrl kbdatabase kbdatabinding kbdesigner kbfix kbvs600sp4fix kbvs600sp5fix KB246919