473,703 Members | 2,671 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 6241

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

Similar topics

2
3112
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 IIS, and reinstalled JUST Visual Studio.NET 2003 with Framework 1.1 (no more 2002 edition or...
29
15540
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" > <HTML> <HEAD>
0
1149
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
1908
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
1573
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 an option for creating a different database. I guess it's best to use two different databases...
0
1395
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
2525
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 defaultProvider="PortalMembershipProvider">
5
1963
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
3438
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 Web app... For ex, in the web site project, if "X" is a profile Property, I can write:
0
9239
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9098
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7843
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6585
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4674
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3111
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
3
2054
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.