Converting ADODB to SQLClient.SQLConnection

Posted on 2009-04-21
Last Modified: 2013-11-07
I have an old VB6 application that was converted to a couple years ago. The program is very SQL intensive (SQL Server 2005), it currently connects using ADODB.Connection and ADODB.Recordset
I would like to convert it to the new .Net connection SQLClient.SQLConnection  but I would like to avoid modifying every line of code in the application
Is there a class somewhere that I can import that would provide a interface to SQLConnection. For instance instead of declaring my record sets of ADODB.REcordset I could declare them as this class and it would be a front end to the new connection, making modifying my existing RS.MoveNext   RS_TMP.Fields("ContactName").Value etc not required,

If someone could point me in the right direction that would be great

Question by:celco
    LVL 83

    Expert Comment

    I dont see it as possible. This highlights the importance of separating the DAL (Data Access Layer) from everything else because then you need to make changes at fewer places.

    Author Comment

    I appreciate your comment. Unfortunately I am not the original programmer so now I am left trying to cleanup the lack of forethought.
    LVL 83

    Expert Comment

    I think you have the option now to convert the project to not only use the ADO.NET but to use the DAL. Because its not just the variable declarations that need changing, there are loads of other changes to be made as you mentioned.

    Accepted Solution

    I left this question open because I did not receive an answer that I thought was worth accepting.
    The only answer was its not possible.

    I was in fact able to make a class as takes all the same calls as the old OLEDB Record set but connects to the database as the new SQLConnection.  As for existing code all I needed to do was change the recordset declaration from the OLEDB to my new class, no other code changes required.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now