473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to use MS Access DB for ASPNET Application Services (membership, profile, etc)

A lot of times, web hostings for ASPNET 2.0 will offer only MS Access
DB for database for basic plan, a question often asked is how can I use
the membership services, role, web parts services, etc for this MS
Access db. Well, microsoft offers a download sample. Instructions
are below.

HOW TO USE MS ACCESS DB FOR ASPNET APPLICATION SERVICES ( membership,
profile, roles, etc providers)

1. Download the Sample Access Provider from microsoft.

http://msdn.microsoft.com/vstudio/eu...f-027e6c8e15d8
This will install a VSI which you can open in Visual Studio 2005.
It contains a sample web.config as well as sample ASPnetDb.mdb
NOTE: web.config has an incorrect provider type. For example:

type="Samples.AccessProviders.AccessMembershipProv ider,
SampleAccessProviders"

"SampleAccessProviders" should have been "ASP.NET Access Providers"
because
that is the name of the DLL created by this class library.
You can use either of this:

1. Change the name of DLL. (by right-clicking on project, in
Applications tab, change the type to 'SampleAccessProviders'.
or
2. Change every occurrence of "SampleAccessProviders" in web.config
with "ASP.NET Access Providers"

In any case, you should be able to get rid the "unable to load Type"
runtime error.


You should create the DLL by compiling the class library project.
2. Create a new web site. Copy ASPnetDb.mdb in the 'App_Data'
directory.
Incorporate the sample web.config file in the class library into the

web.config file in your new website.

3. Select your website in visual studio, Launch ASPNET Configuration
Wizard.
You should be able now to add security.


For example, I changed the namespace of the Sample access providers
project to 'AccessProviders' and also changed the DLL to
'ASP.NET.AccessProviders.dll'

Here is my working sample web.config


<configuration>
<connectionStrings>
<add name="AccessFileName"
connectionString="~/App_Data/ASPNetDB.mdb"
providerName="System.Data.OleDb"/>
</connectionStrings>
<system.web>
<authentication mode="Forms">
<forms loginUrl="mylogin.aspx" defaultUrl="Login.aspx"/>
</authentication>

<membership defaultProvider="AccessMembershipProvider">
<providers>
<clear/>
<add name="AccessMembershipProvider"
type="AccessProviders.AccessMembershipProvider,
ASP.NET.AccessProviders"
connectionStringName="AccessFileName"
enablePasswordRetrieval="false"
enablePasswordReset="false"
requiresUniqueEmail="false"
requiresQuestionAndAnswer="false"
minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0"
applicationName="SampleSite"
hashAlgorithmType="SHA1"
passwordFormat="Hashed"/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="AccessRoleProvider"
cacheRolesInCookie="true" cookieName=".ASPXROLES" cookieTimeout="30"
cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true"
cookieProtection="All">
<providers>
<add name="AccessRoleProvider"
type="AccessProviders.AccessRoleProvider,
ASP.NET.AccessProviders"
connectionStringName="AccessFileName"
applicationName="SampleSite"/>
</providers>
</roleManager>
<profile enabled="true" defaultProvider="AccessProfileProvider">
<providers>
<add name="AccessProfileProvider"
type="AccessProviders.AccessProfileProvider,
ASP.NET.AccessProviders"
connectionStringName="AccessFileName"
applicationName="SampleSite"
description="Stores and retrieves profile data from
an ASP.NET_Access_Providers database."/>
</providers>
<properties>
<add name="FriendlyName" type="string" allowAnonymous="true"
serializeAs="String"/>
<add name="Height" type="int" allowAnonymous="true"
serializeAs="String"/>
<add name="Weight" type="int" allowAnonymous="true"
serializeAs="Xml"/>
</properties>
</profile>
<anonymousIdentification enabled="true"
cookieName=".ASPXANONYMOUS" cookieTimeout="100000" cookiePath="/"
cookieRequireSSL="false" cookieSlidingExpiration="true"
cookieProtection="None" domain=""/>
<webParts>
<personalization
defaultProvider="AccessPersonalizationProvider">
<providers>
<add name="AccessPersonalizationProvider"

type="AccessProviders.AccessPersonalizationProvide r,
ASP.NET.AccessProviders"
connectionStringName="AccessFileName"
applicationName="SampleSite"/>
</providers>
</personalization>
</webParts>

<!--
<trust level="Medium"/>
-->

<compilation debug="true"/>
</system.web>
</configuration>


You can also put the absolute path in the connection strings
<connectionStrings>
AccessFileName"
connectionString="D:\Clients\C240\msite.com\databa se/ASPNetDB.mdb"
providerName="System.Data.OleDb"/>
</connectionStrings>



--------------------------------------------------------------------------------
Last Updated 7/5/2006 7:19:21 AM by 'Editor'
Home | Edit page | List pages | Recent pages | RSS Search for:

Jul 5 '06 #1
0 6219

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Keith Jakobs, MCP | last post by:
Greetings: I had seen several posts around the Internet about this issue from a few months back, but have been unable to find a resolution ... I have a user who is trying to get started with...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
0
by: VB Programmer | last post by:
Out of necessity I may have to use Access to store my membership, profile, etc... info (usually stored in ASPNETDB.mdf) 1. Do I use aspnet_regsql.exe to populate the mdb? If so, any command...
2
by: Runsrealfast | last post by:
I am currently setting up my website to login etc. The default that asp.net is set for is sql server express (express edition, to poor to buy the real thing!) my host will only allow for access....
2
by: dgk | last post by:
I've got an app that's using SQLServer to store the membership and profile data, in the Aspnetdb database. Now I'm going to be adding another app and I'm concerned about using the same database....
0
by: =?Utf-8?B?QV9SZXB1YmxpY2Fu?= | last post by:
This is a portion of my Web.config file: <system.web> <membership defaultProvider="SqlProvider"> <providers> <clear/> <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider"...
1
by: Mike | last post by:
Hi: I have been trying to create a web application that provides suport for two membership/profile databases: one for private users and one for another set of users. These tw user have a...
5
by: Rory Becker | last post by:
Hi All I have a database which has it's own set of tables for users etc I already successfully use the Login control by handling the Authenticate event and checking the suitable values against...
3
by: Oriane | last post by:
Hi there, I would like to open my Asp.Net project as a "Web Application" rather than as a "Web Site" in Visual Studio. But the thing is that I use the System.Web.Profile and the auto-generated...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.