|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Adding a VB6 module to a VB.NET projectHi,
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! "Shacker" <vk***@yankees.gotdns.com> wrote in message Probably not without significant changes; you should ask in a VB.Netnews: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) newsgroup for specifics > or recreate the SQL connection module functionality in a Rewriting existing code is about the only option. VB.Net is *not* VB.> VB.NET module / class file, then add the class file to the VB.NET > project (my contention)? -- <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>
Show quote
Hide quote
"Shacker" <vk***@yankees.gotdns.com> wrote in message If VB.net has modules I wouldn't use them. Rewrite your code into a class in > 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)? vb.net. Michae;
Show quote
Hide quote
"Shacker" <vk***@yankees.gotdns.com> wrote in message To add to the other comments - it only gets worse.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! > 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 Ralph wrote:
Show quoteHide quote > "Shacker" <vk***@yankees.gotdns.com> wrote in message You can use ADO from vb.net/c#/whatever. In fact, vs.net ships with a > 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. 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."Frank Rizzo" <n***@none.com> wrote in message I believe it just uses the old ADO underneath anyway.news:OoVqvlogFHA.2484@TK2MSFTNGP15.phx.gbl... >> Re-write the thing using ADO.Net. (and C#) and be done with it. > That would be cleaner. Michael 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! Michael C wrote:
> "Frank Rizzo" <n***@none.com> wrote in message No, it does not use ADO in any way, shape or form.> 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. Show quoteHide quote > > Michael > > |
|||||||||||||||||||||||