Monday, 9 May 2016

MS Access and LINQPad

Situation:

As most developers, using LINQ queries saves a lot of time and works absolutely great. For me one of the greatest tools for quick and easy querying data and testing code is LINQPad. However, sometimes you get a project where the (backend)database is MS Access (yes, it still happens, even in 2016 :) ).

Problem:

And there starts the problem. There is no MS Access driver for LINQPad, at least no free one.

Solution:

But we are lucky, LINQPad provides a way to create custom drivers. So one of my colleagues, Frank den Outer, made a driver for MS Access to enable you to connect to *.mdb and *.accdb and allows you to query on data from LINQPad on MS Access database (even with password protected ones). So the credits of this post goes to him!

See the screenshots below:






Our company, DNM, offers you this driver for free. You can download is here: MSAccessDataContextDriver.lpx. After the download, start LINQPad, and when creating a new connection, you can easily add the downloaded driver.

Happy programming!

2 comments:

Rexford Joan said...
This comment has been removed by the author.
Rexford Joan said...

Hi the driver is an .lpx file and the access database is a .mdb or .accdb file. -Download the .lpx-file, in LinqPad,
-click on Add connection,
-then click on 'view more drivers...'
-then click on 'browse' and select the .lpx-file
-the driver is added on the top list-box and ready to use it!
http://www.hourglassit.com/