473,545 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.A ccessProviders. AccessMembershi pProvider,
SampleAccessPro viders"

"SampleAccessPr oviders" 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 'SampleAccessPr oviders'.
or
2. Change every occurrence of "SampleAccessPr oviders" 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 'AccessProvider s' and also changed the DLL to
'ASP.NET.Access Providers.dll'

Here is my working sample web.config


<configuratio n>
<connectionStri ngs>
<add name="AccessFil eName"
connectionStrin g="~/App_Data/ASPNetDB.mdb"
providerName="S ystem.Data.OleD b"/>
</connectionStrin gs>
<system.web>
<authenticati on mode="Forms">
<forms loginUrl="mylog in.aspx" defaultUrl="Log in.aspx"/>
</authentication>

<membership defaultProvider ="AccessMembers hipProvider">
<providers>
<clear/>
<add name="AccessMem bershipProvider "
type="AccessPro viders.AccessMe mbershipProvide r,
ASP.NET.AccessP roviders"
connectionStrin gName="AccessFi leName"
enablePasswordR etrieval="false "
enablePasswordR eset="false"
requiresUniqueE mail="false"
requiresQuestio nAndAnswer="fal se"
minRequiredPass wordLength="1"
minRequiredNona lphanumericChar acters="0"
applicationName ="SampleSite "
hashAlgorithmTy pe="SHA1"
passwordFormat= "Hashed"/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider ="AccessRolePro vider"
cacheRolesInCoo kie="true" cookieName=".AS PXROLES" cookieTimeout=" 30"
cookiePath="/" cookieRequireSS L="false" cookieSlidingEx piration="true"
cookieProtectio n="All">
<providers>
<add name="AccessRol eProvider"
type="AccessPro viders.AccessRo leProvider,
ASP.NET.AccessP roviders"
connectionStrin gName="AccessFi leName"
applicationName ="SampleSite "/>
</providers>
</roleManager>
<profile enabled="true" defaultProvider ="AccessProfile Provider">
<providers>
<add name="AccessPro fileProvider"
type="AccessPro viders.AccessPr ofileProvider,
ASP.NET.AccessP roviders"
connectionStrin gName="AccessFi leName"
applicationName ="SampleSite "
description="St ores and retrieves profile data from
an ASP.NET_Access_ Providers database."/>
</providers>
<properties>
<add name="FriendlyN ame" type="string" allowAnonymous= "true"
serializeAs="St ring"/>
<add name="Height" type="int" allowAnonymous= "true"
serializeAs="St ring"/>
<add name="Weight" type="int" allowAnonymous= "true"
serializeAs="Xm l"/>
</properties>
</profile>
<anonymousIdent ification enabled="true"
cookieName=".AS PXANONYMOUS" cookieTimeout=" 100000" cookiePath="/"
cookieRequireSS L="false" cookieSlidingEx piration="true"
cookieProtectio n="None" domain=""/>
<webParts>
<personalizatio n
defaultProvider ="AccessPersona lizationProvide r">
<providers>
<add name="AccessPer sonalizationPro vider"

type="AccessPro viders.AccessPe rsonalizationPr ovider,
ASP.NET.AccessP roviders"
connectionStrin gName="AccessFi leName"
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
<connectionStri ngs>
AccessFileName"
connectionStrin g="D:\Clients\C 240\msite.com\d atabase/ASPNetDB.mdb"
providerName="S ystem.Data.OleD b"/>
</connectionStrin gs>



--------------------------------------------------------------------------------
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 6229

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

Similar topics

2
3096
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 Visual Studio.NET 2003. We have uninstalled and reinstalled the Product.... then we did a complete cleanout of development products, re-installed...
29
15487
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" ---Start of test.aspx---- <%@ Page language="C#" AutoEventWireup="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >...
0
1143
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 line examples? 2. Will I have to change how I code or is it pretty much plug and play once I adjust my command line and setup the mdb? Thanks.
2
1905
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. How can I change the default settings to use access instead of sql server express? please help!
2
1562
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. They will each have different application names but I think it's probably better to have completely different databases. The aspnet_regsql utility has...
0
1387
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" connectionStringName="SqlServices" applicationName="CollegeRepublicans"
1
2516
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 totally different set of profile attributes. I added the following code to my web.config (under system.web): <membership...
5
1958
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 my own DB. Now I need to use the ChangePassword control but I cannot stop the system from trying to create a database.
3
3429
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 class "ProfileCommon myApp.Profile", which provides me with type profile properties. And the fact is that this generated class is not generated with...
0
7487
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6003
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5349
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3476
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.