Home All Groups Group Topic Archive Search About

Adding a VB6 module to a VB.NET project

Author
6 Jul 2005 9:45 PM
Shacker
Hi,

A collegue of mine and I have a matter that needs to be settled...

We have old VB6 code that uses a common SQL connection module and it's
used widely in all of our VB6 code.

We're now writing Windows services in VB.NET that needs to make a SQL
connection.

Can we simply add the VB6 SQL connection module (conn.bas) to the
VB.NET project and call the procedures within them (my collegues
contention) or recreate the SQL connection module functionality in a
VB.NET module / class file, then add the class file to the VB.NET
project (my contention)?

Thanks!

Author
6 Jul 2005 9:50 PM
Bob Butler
"Shacker" <vk***@yankees.gotdns.com> wrote in message
news:1120686323.950979.137950@f14g2000cwb.googlegroups.com
> Can we simply add the VB6 SQL connection module (conn.bas) to the
> VB.NET project and call the procedures within them (my collegues
> contention)

Probably not without significant changes;  you should ask in a VB.Net
newsgroup for specifics

> or recreate the SQL connection module functionality in a
> VB.NET module / class file, then add the class file to the VB.NET
> project (my contention)?

Rewriting existing code is about the only option.  VB.Net is *not* VB.


--
<response type="generic" language="VB.Net">
This newsgroup is for users of Visual Basic version 6.0
and earlier and not the misleadingly named VB.Net
or VB 200x.  Solutions, and often even the questions,
for one platform will be meaningless in the other.
When VB.Net was released Microsoft created new newsgroups
devoted to the new platform so that neither group of
developers need wade through the clutter of unrelated
topics.  Look for newsgroups with the words "dotnet" or
"vsnet" in their name.  For the msnews.microsoft.com news
server try these:

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb

</response>
Author
6 Jul 2005 10:57 PM
Michael C
Show quote Hide quote
"Shacker" <vk***@yankees.gotdns.com> wrote in message
> Hi,
>
> A collegue of mine and I have a matter that needs to be settled...
>
> We have old VB6 code that uses a common SQL connection module and it's
> used widely in all of our VB6 code.
>
> We're now writing Windows services in VB.NET that needs to make a SQL
> connection.
>
> Can we simply add the VB6 SQL connection module (conn.bas) to the
> VB.NET project and call the procedures within them (my collegues
> contention) or recreate the SQL connection module functionality in a
> VB.NET module / class file, then add the class file to the VB.NET
> project (my contention)?

If VB.net has modules I wouldn't use them. Rewrite your code into a class in
vb.net.

Michae;
Author
6 Jul 2005 11:10 PM
Ralph
Show quote Hide quote
"Shacker" <vk***@yankees.gotdns.com> wrote in message
news:1120686323.950979.137950@f14g2000cwb.googlegroups.com...
> Hi,
>
> A collegue of mine and I have a matter that needs to be settled...
>
> We have old VB6 code that uses a common SQL connection module and it's
> used widely in all of our VB6 code.
>
> We're now writing Windows services in VB.NET that needs to make a SQL
> connection.
>
> Can we simply add the VB6 SQL connection module (conn.bas) to the
> VB.NET project and call the procedures within them (my collegues
> contention) or recreate the SQL connection module functionality in a
> VB.NET module / class file, then add the class file to the VB.NET
> project (my contention)?
>
> Thanks!
>

To add to the other comments - it only gets worse.

Not only can you not use a Classic VB module (.bas) file in your .NET
program, you are likely using an ADO connection and ADO.Net ain't ADO.
While, you can use ADO in your .Net app, you would have to interopt, and why
bog your app down any more that you have already done.

Re-write the thing using ADO.Net. (and C#) and be done with it.

-ralph
Author
7 Jul 2005 12:18 AM
Frank Rizzo
Ralph wrote:
Show quoteHide quote
> "Shacker" <vk***@yankees.gotdns.com> wrote in message
> news:1120686323.950979.137950@f14g2000cwb.googlegroups.com...
>
>>Hi,
>>
>>A collegue of mine and I have a matter that needs to be settled...
>>
>>We have old VB6 code that uses a common SQL connection module and it's
>>used widely in all of our VB6 code.
>>
>>We're now writing Windows services in VB.NET that needs to make a SQL
>>connection.
>>
>>Can we simply add the VB6 SQL connection module (conn.bas) to the
>>VB.NET project and call the procedures within them (my collegues
>>contention) or recreate the SQL connection module functionality in a
>>VB.NET module / class file, then add the class file to the VB.NET
>>project (my contention)?
>>
>>Thanks!
>>
>
>
> To add to the other comments - it only gets worse.
>
> Not only can you not use a Classic VB module (.bas) file in your .NET
> program, you are likely using an ADO connection and ADO.Net ain't ADO.
> While, you can use ADO in your .Net app, you would have to interopt, and why
> bog your app down any more that you have already done.

You can use ADO from vb.net/c#/whatever.  In fact, vs.net ships with a
pre-interroped ADO assembly.  It works fine.  Porting the code is quite
easy and straightforward, if all it does is connect to a database.  I
would run the upgrade wizard on it - you'll probably get close to a 100%
conversion on something simple as that.

> Re-write the thing using ADO.Net. (and C#) and be done with it.
That would be cleaner.
Author
7 Jul 2005 4:28 AM
Michael C
"Frank Rizzo" <n***@none.com> wrote in message
news:OoVqvlogFHA.2484@TK2MSFTNGP15.phx.gbl...
>> Re-write the thing using ADO.Net. (and C#) and be done with it.
> That would be cleaner.

I believe it just uses the old ADO underneath anyway.

Michael
Author
7 Jul 2005 2:42 PM
Shacker
Thanks everyone!  We're going to compile the VB6 module into a DLL /
COM object and use that until we can write a proper .NET class that we
can use globally.

Thanks for everyone's replies!
Author
14 Jul 2005 7:06 AM
Frank Rizzo
Michael C wrote:
> "Frank Rizzo" <n***@none.com> wrote in message
> news:OoVqvlogFHA.2484@TK2MSFTNGP15.phx.gbl...
>
>>>Re-write the thing using ADO.Net. (and C#) and be done with it.
>>
>>That would be cleaner.
>
>
> I believe it just uses the old ADO underneath anyway.

No, it does not use ADO in any way, shape or form.

Show quoteHide quote
>
> Michael
>
>