Previous | Index | Next 

[PRB] Conversion fails with a "Project item name not found" error

VB Migration Partner can convert only projects created with Visual Basic 6 and doesn’t support projects created with earlier versions. However, you should be aware that in some special (and rare) cases the conversion may fail if it is attempted on a project that was developed using a VB version earlier than VB6, even though it compiles correctly under VB6 and even if it was saved from inside the VB6 IDE. This article explains when this problem can occur.

Any form, class, or module that you create with VB6 contains a special hidden source code line that defines the name of the project item, as in this example:

        Attribute  VB_Name = "Module1"

The VB_Name attribute is always present when the project item is a class or a UserControl, but it might be missing if (a) the file is a form or a module that was created using an earlier VB version and then imported into VB6, and (b) you never modified and re-saved the file from inside the VB6 IDE. If these two conditions are met, the attribute is missing and VB Migration Partner fails with the following error message:

        Project item name  not found for file c:\foo.ctl

If the project item is a module or a class, however, VB Migration Partner tries to remedy by using the name found in the .vbp file. In this case it emits a warning (instead of a fatal error) which reads

        Project item name not found. Name 'foo'  assume for file c:\foobar.cls

This assumption is often correct and the migration can complete successfully. In a few cases, however – most notably, when the file is severely corrupted – the migration might fail later because code references to the class or module in question can’t be resolved. When this happens, please carefully review your VB code using an external editor (e.g. Notepad) to ensure that all name attributes are correctly set.


Previous | Index | Next