In addition to the answers given above, you can also do the following (which works not only for Access, but also for MySQL, Oracle, PostgreSQL, and a couple of other database systems):
- Click "Add connection" in LinqPad
- The "Choose Data Context" dialog opens
- Click the button View more drivers...
- Scroll down a bit until you see "LINQ to DB Driver"
- Click on the link button "Download & Enable Driver".
- Wait until you see "Driver successfully updated." Then click OK.
- You should see the "Choose Data Context" dialog again, but this time with an additional entry "LINQ to DB". Select it and Click Next >
- The "LINQ to DB Connection" dialog opens. As Data Provider select "Microsoft Access"
- Enter a connection string*) like for example
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\MYUSER\Documents\myAccessDB.accdb;Persist Security Info=False
- Verify the connection by clicking Test. It should give you a "Successful!" message.
- Close the dialog by clicking OK
Now you're ready using your Access database.
*)Hint: To create a valid connection string, you can use the following trick:
Create a new, empty text file on the desktop and give it the extension .udl
, for example Connection.udl
. Then, double click on it and you will get a configuration dialog where you can select a provider, enter server, database etc. as required. Confirm it with OK and open the file Connection.udl
with Notepad afterwards. You will see a valid connection string that you can copy and paste (copy just the line Provider=...
).