troubleshooting Question

Ado.net with VB.net

Avatar of luca345
luca345 asked on
Visual Basic Classic
68 Comments1 Solution561 ViewsLast Modified:
Hi ,

I need to migrate from VB6 Ado Recordset to VB.NET Ado.net.

I see that in Ado.net there are two types:

1) Oledb
2) SqlClient

Now I must convert differents large projects and I like to use the some modules.

In short I need a easy way to change on fly with only one set (if possible) these declares.

I have thinking 2 teorically ways to do it:

1) -- The best Solution ---

//
Use "Oledb"

In all project if I declare for example:

Dim CNN as new Connection (The compiler see 'new Connection' = 'new Oledb.Connection')

Use "SqlClient"

In all project if I declare for example:

Dim CNN as new Connection (The compiler see 'new Connection' = 'new SqlClient.Connection')



//



I hope is possible do it


1) -- The compromise Solution ---

//

Use "Oledb"

In all project if I declare for example:

Dim CNN as new My_Custom_Connection (The compiler see 'new My_Custom_Connection' = 'new Oledb.Connection')

Use "SqlClient"

In all project if I declare for example:

Dim CNN as new My_Custom_Connection (The compiler see 'new My_Custom_Connection' = 'new SqlClient.Connection')


//


I use all types of database Access , SQL Server , My SQL.

For this reason for me is very important switch easy these two types without 'replace all' that is not professional.

Can you help me ??
ASKER CERTIFIED SOLUTION
Chris Raisin
Retired Senior Systems Analyst/Programmer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 68 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 68 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros