BUG: You receive a "Class not registered" error message in Visual Basic 6.0 project after you remove Visual Studio .NET or Visual Studio 2005 (814707)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition
  • Microsoft Visual Studio .NET (2003), Professional Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Standard Edition
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

SYMPTOMS

You have Visual Studio .NET or Visual Studio 2005 installed on your computer. You create a Visual Basic 6.0 project that has a control that is bound to a data source. When you remove Visual Studio .NET or Visual Studio 2005 and then run you Visual Basic 6.0 project, you receive the following error message:
Run-time error '713':
Class not registered.
Looking for object with
CLSID:{59245250-7A2F-11D0-9842-00A0C91110ED}

CAUSE

This problem occurs because the Component Object Model (COM) based MSBind.dll is unregistered when you remove Visual Studio .NET or Visual Studio 2005. Visual Basic 6.0 uses MSBind.dll to bind the control to the data source. Therefore, when you run a Visual Basic 6.0 project that has a data-bound control, you receive the run-time error message.

RESOLUTION

To resolve this problem, register MSBind.dll again. To do this, you can use the Regsvr32.exe tool or you can add the reference to your Visual Basic 6.0 project so that the DLL is registered automatically. To add the reference to your project, follow these steps:
  1. In Visual Studio .NET or in Visual Studio 2005, open your Visual Basic project.
  2. On the Project menu, click Add References.
  3. Click Browse, and then locate the MSBind.DLL assembly in the system32 folder.
  4. Click MSBind.DLL, and then click Open.

    Note In Visual Studio 2005, you do not have to click Open.
  5. Click OK to apply the references to the project.
  6. On the Run menu, click Start.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the behavior

  1. In Control Panel, click Add or Remove Programs. Click Microsoft Visual Studio .NET or Microsoft Visual Studio 2005, and then click Change/Remove.
  2. In the Setup wizard, click Uninstall Visual Studio .NET or Uninstall Visual Studio 2005.
  3. After you remove Visual Studio .NET or Visual Studio 2005, start a new Standard EXE project in Microsoft Visual Basic 6.0. By default, Form1 is created.
  4. In the Toolbox, double-click the CommandButton control, and then double-click the TextBox control.
  5. Add the following code to the Click event of Command1:
    Private Sub Command1_Click()
    Dim cn As New ADODB.Connection
    Dim cmd As New ADODB.Command
    Dim rs As New ADODB.Recordset
    'Create the connection to the SQL Server.
    cn.Open ("Provider=SQLOLEDB.1;Persist Security Info=False;User ID=YourUserId;Password=YourPassword;Initial Catalog=Northwind;Data Source=YourSQLServer")
    cn.CursorLocation = adUseClient
    cmd.CommandText = "select * from Products"
    cmd.ActiveConnection = cn
    'Run the SQL query in the Command Text.
    Set rs = cmd.Execute
    'Bind the TextBox to the Recordset rs.
    Set Text1.DataSource = rs
    Text1.DataField = "Productname"
    End Sub
    Note In the Connection String, replace YourSQLServer with the name of your local computer running SQL Server. Replace YourUserId and YourPassword with your SQL Server user ID and password.
  6. On the Project menu, click Add References.
  7. Click to select the check boxes for Microsoft Data Binding Collection and Microsoft ActiveX Data Objects 2.0 Library.
  8. On the Run menu, click Start.
  9. Click Command1.

REFERENCES

For more information, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:3/6/2006
Keywords:kbvs2005applies kbvs2005swept kbvs2002sp1sweep kberrmsg kbDLL kbDataBinding kbRegistry kbbug KB814707 kbAudDeveloper