change web.config connections from sql to access

Posted on 2011-10-04
Last Modified: 2012-05-12
In code-snippet is the standard code to connect to a sql database. How do I change this code that it works with ms access ?
I know the connction string is eg <!--      <add name="ApplicationServices" connectionString="~/App_data/aspnetdb.mdb" providerName="System.Data.OleDb"/>-->

 but what about the rest ?

		 <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />  
		<compilation debug="true" targetFramework="4.0"/>
		<authentication mode="Forms">
			<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
				<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
				<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
		<roleManager enabled="false">
				<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
				<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
		<modules runAllManagedModulesForAllRequests="true"/>

Open in new window

Question by:dekempeneer
    LVL 17

    Expert Comment

    by:Carlos Villegas
    The best place for connection string details:


    Access 2007:

    Look for .NET Framework Data Provider

    Author Comment

    Yes, the connectionstring  ave, but I think I need to replace the System.Web.Security.SqlRoleProvider and such as well ?
    LVL 17

    Accepted Solution

    mmm I see, sorry but .net currently dont have a native RoleProvider class for OleDb, you must create a custom one that inherit from System.Web.Security.RoleProvider to interact with your Access DB.

    System.Web.Security.RoleProvider reference:

    You can see an example of how to implement that here: (example for odbc but adaptable to OleDb) (OleDb, based in the first link)
    LVL 19

    Expert Comment

    by:Amandeep Singh Bhullar
    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now