Link to home
Start Free TrialLog in
Avatar of dekempeneer
dekempeneerFlag for Belgium

asked on

change web.config connections from sql to access

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 ?


<configuration>
	<connectionStrings>
		 <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />  
		</connectionStrings>
	<system.web>
		<compilation debug="true" targetFramework="4.0"/>
		<authentication mode="Forms">
			<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
		</authentication>
		<membership>
			<providers>
				<clear/>
				<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="/"/>
			</providers>
		</membership>
		<profile>
			<providers>
				<clear/>
				<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
			</providers>
		</profile>
		<roleManager enabled="false">
			<providers>
				<clear/>
				<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
				<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
			</providers>
		</roleManager>
	</system.web>
	<system.webServer>
		<modules runAllManagedModulesForAllRequests="true"/>
	</system.webServer>
</configuration>

Open in new window

Avatar of Carlos Villegas
Carlos Villegas
Flag of United States of America image

The best place for connection string details:
http://www.connectionstrings.com/

Access:
http://www.connectionstrings.com/access

Access 2007:
http://www.connectionstrings.com/access-2007

Look for .NET Framework Data Provider
Avatar of dekempeneer

ASKER

Yes, the connectionstring  ave, but I think I need to replace the System.Web.Security.SqlRoleProvider and such as well ?
ASKER CERTIFIED SOLUTION
Avatar of Carlos Villegas
Carlos Villegas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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.