Take the 2-minute tour ×

I'm totally new to Web Programming, and have been asked to produce a web form that will be hosted on the company Intranet Site. The form will be used to submit data to a back end database.

My problem is that the database has been developed using MS Access 2007. Whereas I would like to use ASP.NET MVC 3 I'm not sure I will be able to us MS Access for this as a back-end database. Most examples I seem to find all hook up to SQL Server (Data Context), which i understand is the best way to go about it.

My problem is that due to time restrictions, I wont be able to change this database over to SQL at present. There has been a lot of work done creating things such as Forms, Reports etc within the Access Database that I don't have time to replicate in .Net for now.

Can anyone give me some advice on which would be the best method for building a Intranet Data Entry form in the short term.

I will look to bring the entire project up to date when the time is available.

share|improve this question
there's no reason why you have to use MSSql as you model. It's just that MS Sql is much better than MS access. What's you preffered data access technology? ADo.Net,Enity framework, something else? –  Liam Jun 25 '12 at 11:20
Thx, I'm familiar with ADO.Net, I'll go with this. Thanks –  Derek Jun 25 '12 at 11:57

3 Answers 3

You should be able to simply add the Access connection string to the web.config file and use that DB instead.

    <add name="MyConn" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|name_of_db.accdb;" providerName="System.Data.OleDb" />

Model-View-Controller is a software design pattern, referring to separation of the interface and logic.

share|improve this answer

You can still use MVC with MS Access. You could use the OLEDBConnection class, however I would recommend you use an ORM such as NHibernate which supports Access connectivity (Tutorial outlined below).

At a later date you can simply map all of the NHibernate mappings to SQL Server and switch the connection string which will point at your new SQL Server database rather than MS Access.

Linking MS Access to NHibernate:


Connecting to MS Access via OLEDB:


share|improve this answer
// C#
public void ConnectToAccess()
    System.Data.OleDb.OleDbConnection conn = new 
    // TODO: Modify the connection string and include any
    // additional required properties for your database.
    conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
        @"Data source= C:\Documents and Settings\username\" +
        @"My Documents\AccessFile.mdb";
        // Insert code to process data.
        catch (Exception ex)
        MessageBox.Show("Failed to connect to data source");

More info at MSDN.

share|improve this answer

Your Answer


