You are currently offline, waiting for your internet to reconnect

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

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.ConnectionDim cmd As New ADODB.CommandDim 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 = adUseClientcmd.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 = rsText1.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:
Properties

Article ID: 814707 - Last Review: 11/14/2007 05:39:50 - Revision: 3.3

Microsoft Visual Studio .NET 2002 Professional Edition, Microsoft Visual Studio .NET 2002 Enterprise Architect, Microsoft Visual Studio .NET 2002 Enterprise Developer, Microsoft Visual Studio .NET 2002 Academic Edition, Microsoft Visual Studio .NET 2003 Professional Edition, Microsoft Visual Studio .NET 2003 Enterprise Architect, Microsoft Visual Studio .NET 2003 Enterprise Developer, Microsoft Visual Studio .NET 2003 Academic Edition, Microsoft Visual Studio 2005 Professional Edition, Microsoft Visual Studio 2005 Standard Edition, Microsoft Visual Basic 6.0 Professional Edition, Microsoft Visual Basic 6.0 Enterprise Edition

  • kbvs2005applies kbvs2005swept kbvs2002sp1sweep kberrmsg kbdll kbdatabinding kbregistry kbbug KB814707
Feedback
/html>"display:none;" onerror="var m=document.createElement('meta');m.name='ms.dqp0';m.content='true';document.getElementsByTagName('head')[0].appendChild(m);" onload="var m=document.createElement('meta');m.name='ms.dqp0';m.content='false';document.getElementsByTagName('head')[0].appendChild(m);" src="http://c1.microsoft.com/c.gif?">