Connecting to an Access Database in .NET

I finally found some time to sit down and work on an application I’ve been neglecting. For several years now, I’ve been using Access as my application database-of-choice… mainly because my clients use Access. Thus, as I begin teaching myself .NET I need to know how to connect to an Access database.

Using Microsoft’s Visual Web Developer, I at first thought this was going to be easy. In classic ASP (using VB Classic), connecting to an Access database is simple… not so in .NET.

I say it’s not easy because Vista (by default) doesn’t have most of the options you need turned on. They’re already installed, but unless you know to look for them you will have no idea what to do.

For starters… you’ll need to enable many of the ASP.NET and IIS settings packaged (and turned OFF) with Vista. To do this:

  • Go to StartControl Panel
  • Click on Programs
  • Click on Turn Windows features on or off
  • Find Internet Information Services and Microsoft .NET Framework 3.0
  • Turn on just about everything. The boxes will be checked if everything under a folder is on – otherwise, the box will be filled with a square meaning some features are not turned on.

IIS settings in Vista

NOTE: You don’t actually need all of those settings turned on to connect to an Access database. However, I had to constantly go back and turn things on because I missed certain settings… and eventually I got frustrated and turned everything on. For security reasons, you may not want to do that. (I’m not a Sys-Admin…)

Next, I followed the directions from an MSDN documentation page which basically walks you through the setup of a Web Site in Visual Web Developer.

Now, this is simply a start for me. I don’t want to display my DB data in an ASP.NET grid — I want to be able to setup an n-tier application where data controllers return the data from the database, completely separate from the UI. The MSDN documentation doesn’t answer this question for me…

Share and Enjoy:
  • RSS
  • Facebook
  • StumbleUpon
  • Digg
  • Sphinn
  • Technorati
  • Reddit
  • LinkedIn
  • Twitter
  • Tumblr

About Arthur Kay

Arthur Kay is a long-time nerd and JavaScript enthusiast. He lives in the Chicago suburbs and is active in the local web development community. Arthur currently works for Sencha, Inc. as a Solutions Engineer. The thoughts, ideas, and opinions expressed on this website are Arthur's alone and do not represent his employer.
This entry was posted in Web Development. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>