Solved

Vb.Net - Post Conversion Upgrade Warnings

Posted on 2013-12-26
8
320 Views
Last Modified: 2014-01-02
Good Day Experts!

I have my VB6 project upgraded to VB.Net 2005 with the help of FernandoSoto.  I only had 1 error at the bottom of my VB.Net editor and I was able to resolve it without much trouble.  

However, I have many warnings within my code from the conversion process as below...

"UPGRADE_WARNING: Couldn't resolve default property of object..."

There are no "blue squiggly" error lines under the code that each of these UPGRADE_WARNINGS are referring to.

Since there are no errors, do I have to do anything with these? If so, in general what do I have to do with them?

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39740021
Hi jimbo99999;

Try and see if this this the cause of the "UPGRADE_WARNING" in the project.

Late-bound default property reference could not be resolved
0
 

Author Comment

by:Jimbo99999
ID: 39740054
Thanks for responding Fernando.

Ok, I checked out your link but that was not the scenario with the textbox that I have here.
But it made me think...if I may run this by you.  Most of the issues have .Value at the end.

Here is an example:

Dim ShipFromZip As Object
ShipFromZip = rs.Fields("shipfromzip").Value

When I take the .Value off the end, intellisense provides Value as a valid selection.  So I am not sure what it is barking at.

Here is another example:

Dim d As mshtml.HTMLDocument
d.body.all("txtName").Value = "User"

When I take the .Value off the end, intellisense does not provide Value as a valid selection.  So I am not why it is not giving me an error or even if that is why the UPGRADE_WARNING is present.

Thanks,
jimbo99999
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39740094
Hi jimbo99999;

In this statement, "ShipFromZip = rs.Fields("shipfromzip").Value", what is the type of object of rs?

In this statement, "d.body.all("txtName").Value = "User"", the object d being  an object HTMLDocument the method body should return the document body but I am not sure what the method All("txtName") does. In .Net properties are usually called Text and Not Value.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Jimbo99999
ID: 39740134
Dim rs As ADODB.Recordset
Dim ShipFromZip As Object
ShipFromZip = rs.Fields("shipfromzip").Value

This is up at the top of the project:
Imports VB = Microsoft.VisualBasic

I did not put it there.  Does that mean I can keep using the rs recordset?
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39740205
Hi jimbo99999;

Warnings will not stop a program from compiling. They are just that warnings to be aware of that might cause an issue. In this code you might get rid of the warning by changing the code as follows.

' From this
Dim rs As ADODB.Recordset
Dim ShipFromZip As Object
ShipFromZip = rs.Fields("shipfromzip").Value

' To This
Dim rs As ADODB.Recordset
Dim ShipFromZip As String
ShipFromZip = CType(rs.Fields("shipfromzip").Value, String)

Open in new window

0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39740218
Also you asked about this, Imports VB = Microsoft.VisualBasic, yes you do need this. some of the objects that were converted to .Net lives in that name space and if it were not there you would get errors ending with "are you missing a namespace or reference".
0
 

Author Comment

by:Jimbo99999
ID: 39740563
Excellent information...thanks.

I was looking at the original VB6 project and found something interesting.


The original --> Dim ShipFromZip
The converted--> Dim ShipFromZip As Object


What type is no type in VB6 in VB.Net?

Is that why you made it a string?

Good stuff here...not my forte but learning quite a bit.

jimbo99999
0
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 39740833
Hi jimbo99999;

To your question, "What type is no type in VB6 in VB.Net?", not sure about VB6 for I did not use it much but the Variant Data Type in VB6 which is not explicitly declared as some other type has no specific data type. The Variant data type can not be used in VB .Net.  As far as VB .Net ALL variables must be typed. The earlier versions of VB .Net variables in the program needed to be of a specific data type. When Linq was implemented into the language variables did not need to have a specific type in the source code but the datatype was determined at compile time and this is call type inference. .Net languages are type safe and therefore by compile time the type of any variable must be determined if not by you then by the compiler.

To your question, "Is that why you made it a string?", no, from what I could see the function was returning an object of type string as an Object type and to make sure that it would function correctly with whatever function it was to interact with I cast the return too an explicit type.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question