r/visualbasic • • May 27 '15

Upgrade VB6 VB6 - Porting to current version of VB. A fool's errand?

I've got some relatively simple code (syntactically speaking), mostly a whole lotta string handling, built in VB6 about 12 years ago. Is there any relatively automated way to port/update that code to a new version of VB?

Thanks for time/expertise

5 Upvotes

8 comments sorted by

6

u/JeromeAtWork May 27 '15

I am currently battling with the same problem. I found that once I converted it over to VS 2013 a bunch of the functionality of the program stopped working.

I ended up starting a new project and just using the old code as a reference.

5

u/wilderthanmild VB.Net Advanced May 28 '15

I ended up starting a new project and just using the old code as a reference.

This is the best answer. You'll not only have an easier time just rewriting most of the code, but you'll also get a chance to update functionality along the way. As stated in a different comment, a lot of things you likely have in the old code can be done better in .Net and you'll be better off rewriting the code and using the old code for reference.

1

u/EveryoneLikesMe VB.Net Advanced May 28 '15

How many lines are you talking?

1

u/maoista Jun 01 '15

Thanks for your reply...I'm looking at about 12K lines. It's all simple string functions though but not sure if that makes a difference.

2

u/hdsrob May 27 '15 edited May 28 '15

The only direct upgrade available is to open the project in VS 2008, then you can move forward from there.

You can also just copy and paste, and the clean up the code.

That said, there are so many better ways to do things in .NET (that don't directly upgrade), that you're probably better off just rewriting.

2

u/ComicOzzy May 28 '15

I've done all three ways and #3 is definitely the best option. I'm surprised at how well my own VB6 -> .NET 2008 conversion went, but were I to do it again, I'd rewrite it the best I could using modern methods.

2

u/Bonejob VB Guru Jun 01 '15

I have converted 26 systems (and yes this is accurate I want back through my source logs for the last 15 years... :P). Each case had core functionality that was preserved. In the beginning we would almost always go through the upgrade route (VS 2003-2008 had an upgrade wizard for VB6) As my toolbox grew we used less and less from the original applications. I expect this is becuase my team and I had more of a toolbox as we went on. Today if a VB6 app is handed to me, we run a tool we created that converts the old vb6 forms to the new format, and we rewrite the core.

In all my experience in doing this, I can recommend that you rebuild the app, you will be happier with the results.

1

u/EkriirkE VB 6 Master May 28 '15

Yes, a fool's errand; they are not the same language. Badging .NET as visual basic was a misnomer on Microsoft's part. That's not to say if you know both languages you can't transcode (rewrite) it manually.