Converting ADODB to SQLClient.SQLConnection

Posted on 2009-04-21
Medium Priority
Last Modified: 2013-11-07
I have an old VB6 application that was converted to VB.net 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
  • 2
  • 2
LVL 83

Expert Comment

ID: 24204107
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

ID: 24204881
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

ID: 24205107
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

celco earned 0 total points
ID: 24466596
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

807 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