Microsoft KB Archive/814707

= BUG: You receive a &quot;Class not registered&quot; error message in Visual Basic 6.0 project after you remove Visual Studio .NET or Visual Studio 2005 =

Article ID: 814707

Article Last Modified on 11/14/2007

-

APPLIES TO


 * 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

-





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.
 * 1) Click OK to apply the references to the project.
 * 2) On the Run menu, click Start.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the behavior
 In Control Panel, click Add or Remove Programs. Click Microsoft Visual Studio .NET or Microsoft Visual Studio 2005, and then click Change/Remove. In the Setup wizard, click Uninstall Visual Studio .NET or Uninstall Visual Studio 2005. 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. In the Toolbox, double-click the CommandButton control, and then double-click the TextBox control.  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 (&quot;Provider=SQLOLEDB.1;Persist Security Info=False;User ID=YourUserId;Password=YourPassword;Initial Catalog=Northwind;Data Source=YourSQLServer&quot;) cn.CursorLocation = adUseClient cmd.CommandText = &quot;select * from Products&quot; 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 = &quot;Productname&quot; End Sub Note In the Connection String, replace  with the name of your local computer running SQL Server. Replace  and   with your SQL Server user ID and password. </li> On the Project menu, click Add References.</li> Click to select the check boxes for Microsoft Data Binding Collection and Microsoft ActiveX Data Objects 2.0 Library.</li> On the Run menu, click Start.</li> Click Command1.</li></ol>

<div class="references_section">