none
ADODB to ADO.NET wrapper? RRS feed

  • Question

  • Hello,
    I have a large .Net application with all the data access in ADODB. This was a result of migrating from VB6 without touching data access code.
    Now, assuming that I can isolate DA code and can list out all the the specific ADODB libraries/methods currently being used, is it a realistic to attempt a wrapper that translates ADODB to ADO.Net? Can I call the wrapper ADODB, have classes called RecordSet, Command, etc, implement all the required properties, methods, that have ADODB names, but internally use ADO.Net? If I could do it, I will be able to switch from ADO to ADO.Net by simply changing references.
    If it is a bad idea, please be gentle with the rebuke, but please let me know why it would be a bad idea. :-)

    Thanks in advance for your time!
    Tuesday, April 14, 2009 9:04 PM

Answers

  • Given that the object models and functionality are quite different it would probably be rather challenging to do. I'm pretty sure there is some functionality in ADO for which there is no corresponding functionality in ADO.NET. You would have to figure out some way to bridge that gap.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, April 15, 2009 2:58 PM
  • ADO was built around connected environment where applications use cursors to feed data. ADO.NET built around disconnected environment where no cursors (except read-only, forward-only) exist and all the data loaded into DataTables. It makes quite a difference in approach how applications built around those technologies. It is not just a matter of syntax, but how applications use the data. Assuming wrapper exists, I do not think it will address all design issues assocciated with the switch from ADO to ADO.NET
    Val Mazur (MVP) http://www.xporttools.net
    Thursday, April 16, 2009 10:02 AM
    Moderator

All replies

  • See You receive unexpected errors when using ADO and ADO MD in a .NET Framework application
    I suggest you split your application into different layers so you can replace the data access layer without affecting other layers.


    MSMVP VC++
    Tuesday, April 14, 2009 11:43 PM
  • Sheng,
    Thanks for the reply. Sorry, I was probably not clear in my post. What I was getting is the same thing you have recommended - ie, 'replace the data access layer'. What I was wondering is if it would be possible to keep my current code (that uses ADODB), while building a .net component that mimics ADODB class/method/attribute names. I have tried to describe the approach in my original post.
    Wednesday, April 15, 2009 3:00 AM
  • Given that the object models and functionality are quite different it would probably be rather challenging to do. I'm pretty sure there is some functionality in ADO for which there is no corresponding functionality in ADO.NET. You would have to figure out some way to bridge that gap.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, April 15, 2009 2:58 PM
  • ADO was built around connected environment where applications use cursors to feed data. ADO.NET built around disconnected environment where no cursors (except read-only, forward-only) exist and all the data loaded into DataTables. It makes quite a difference in approach how applications built around those technologies. It is not just a matter of syntax, but how applications use the data. Assuming wrapper exists, I do not think it will address all design issues assocciated with the switch from ADO to ADO.NET
    Val Mazur (MVP) http://www.xporttools.net
    Thursday, April 16, 2009 10:02 AM
    Moderator