Converting VB 6 to .net

P

Paulo

Hi,

VS 2005, File -> Open -> projectVB6.vbp

After conversion, I hit CTRL+F5 and shows me up a lot of errors...

What is the best form to convert vb 6 to .net?

Thanks!

Some errors below... 157 to be more exact...

Error 1 'Me' cannot be the target of an assignment.
C:\Eris\Central_VB6\ErisCentral.NET\CONEXAO_rdo.vb 242 3 ErisCentral
Error 14 'SelStart' is not a member of 'System.Windows.Forms.TextBox'.
C:\Eris\Central_VB6\ErisCentral.NET\GENUTILS.vb 192 55 ErisCentral
Error 21 'As Any' is not supported in 'Declare' statements.
C:\Eris\Central_VB6\ErisCentral.NET\Global_rdo.vb 37 173 ErisCentral
 
S

sloan

If you're still using RDO, (or even ADO), then...you got some work ahead of
you.

Global_rdo is what I saw which hinted me to this.

...

Before you convert, you need to learn about ADO.NET (which is NOT ADO).

Google.

DataSet
IDataReader
ExecuteNonQuery
LoadDataSet

stuff like that.

You data access (when converted) should not go through RDO or ADO.

That was one of the reasons I abandoned the UpConvert Wizard.
 
N

Norman Yuan

No serious VB6 project can be converted into .NET project and run. Complete
re-code everything in .NET way manually is the only viable conversion.
 
S

sloan

Re-coding will end up saving you time in the end.

Spec out your product.

Convert it. Try to do it without feature-upgrades at first.

Then after its done, you can test it against the old product.

...

Sorry, but thats the cost usually.

VB.NET and VB6 are only syntax related at the end of the day. ("Dim x as
int").
They are completely different things, no matter how hard MS tries to tell
you they are not.

...........

If you're going to rewrite it, you should search for C# to VB.NET
comparisons.

My opinion. Every manager in the world is going to think "Going from VB6 to
VB.NET is the quickest/best way".
My personsal experience (emphasis on the "my" part, as in this is my one
opinion among many) is that you only end up bringing your bad non-OO habits
with you, and C# will actually give you a cleaner break.

Good luck.
 
S

Shuja Ali Zaroo

To add to what others have already posted. VB.NET is purely an object
oriented language and if you are doing a direct upgrade from VB 6 using the
wizard, you are actually not taking advantage of .NET framework and what it
has to offer. You would be better off re-writing the application right form
design and leverage all the offerings that .NET framework has for you.

Shuja
 
C

Cowboy \(Gregory A. Beamer\)

Rewrite.

While that sounds snooty, there are dozens of reasons for it.

1. If you are using less than the latest suggested dev techniques, the
upgrade will likely fail with numerous errors.
2. You have learned more about your applications and business since this
point in time.
3. In VB6, you were not using OO techniques to develop (at least in most
instances) and you have other coding practices that do not fit well with
..NET.
4. It is often faster to rewrite, knowing everything you know now, than to
upgrade.

I add a disclaimer here. It can be useful to upgrade utility methods to
..NET, as that will speed up development and not likely negatively impact you
too much.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top