.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Membership provider for MS Access in VB

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Hi all,

Over the past few weeks I've been attempting to convert the readily available C# code for the Membership Provider etc whilst working with MS Access. I'm fairly experienced with VB unlike C# and have ran AccessMembershipProvider.cs, AccessConnectionHelper.cs and so on through 3 different converters. All of which have given a varying degree of errors, all of which I've fixed, either by ever so slightly re-writing the logic or in the Cryptographic case finding a working translation.

This evening I have fixed all of the errors from all of the now converted VB files (which I was pretty pleased about as you can imagine), I then created a simple login page to test this out, added a new user to the system and tried to login to find out I'm being told the username or password is wrong.

Just to clarify, the converters all had an error or two or even more in some cases which I've bypassed but now I can't login - at all!!

Any initial suggestions?

Finally I've written reams of code over the years and am really stumped on this one, has knowone actually successfully converted these files from C# to VB and actually got it working?? I'm not looking for someone to send me there hard work but I am almost at the point of not wanting to bother with it anymore and I just can't believe that it's not out there to download

View Complete Post

More Related Resource Links

access denied error in custom login page using custom membership provider/ roleprovider in the FBA u



I have deployed my custommebrship assembly and role provider assembly in the sts web config , central admin web config  and current web appln web config 's. i have created a  dll which has  login control and in the sign_authenticate event i am creating the securitytoken.

when i establish a session using the security token created using the iissettings object, and  while tryibng to redirect to the   home page of the/landing page of the web appln am Getting access denied error. 

signInControl_Authenticate(object sender, AuthenticateEventArgs e)




e.Authenticated = true; //till this line  it worked success.

 base.RedirectToSuccessUrl(); //here it throws  :" Eror: access  denied "     current ly signed in user : myname sign is as   diuff. user


anybody knows how to overcome this , means authentication is  success, but authoriation didnt work.

 how can i get asuccessfull login to theweb appln/ siteccollection? in my role provder class i  have created my own roles

for user name: myname

role name:  Administrators, Contributor.

any help is appreciated





Membership Provider Conn String


Hello. I've bee successfully using the Asp.Net Membership Provider in my VB.Net 3.5/SQL 2005 web app for a year now (Site A). However, I've added 2 new sites (B and C) (both with their own DB) and now I see a problem. It looks like users that get created for sites B and C also get created in site A. Roles that I create for B and C only get created in A. I think it is a conn string problem.

When I created A, I adde the conn string to my machine.config (not sure why I did this or if it is even needed)...


         <add name="LocalSqlServer" connectionString="Data Source=VS689\SQLEXPRESS;Initial Catalog=SiteA;USER ID=sa;PASSWORD=123456"/>


                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=blahblah" connectionStringName="LocalSqlS

ADO.NET: Building a Custom Data Provider for Use with the .NET Data Access Framework


The System.Data.dll assembly in the .NET Framework contains namespaces whose base classes can be used to create custom data providers. These namespaces also define a number of data access interfaces and base classes that let developers create data providers that will interoperate with other custom providers. Using the ADO.NET classes Connection, Command, DataReader, and DataAdapter, writing a provider is easier than writing one for OLE DB. This article explains these classes and their implementation, and how they can be used to write a variety of different kinds of data providers.

Bob Beauchemin

MSDN Magazine December 2001

Connect to MS Access via OLEDB provider


I am attempting to use the 64-bit OLEDB Provider for Access found in the "Microsoft Access Database Engine 2010 Redistributable" to connect to and query an Access 2003 database that is on another server separate from my SharePoint server. I have not had any success making the connection. My SharePoint server is Windows Server 2008 SP2 and I am running MOSS 2007 (patched up to the April 2010 CU)

Here is the connection info in my Application Definition XML:

    <LobSystemInstance Name="LessonsLearnedDevOLEDB_Instance">
        <Property Name="AuthenticationMode" Type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAuthenticationMode">RevertToSelf</Property>
        <Property Name="DatabaseAccessProvider" Type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAccessProvider">OleDb</Property>
        <Property Name="rdbconnectionData Source" Type="System.String">\\server1\share1\Lessons.mdb</Property>
        <Property Name="rdbconnectionProvider" Type="System.String&qu

Implementing a custom Membership Provider vs. using aspnet_Profile table - Which should I do?


I wanted to expand the amount of information that is associated with each user(MembershipUser) in the ASPNETDB.MDF database file. Adding columns like FirstName, LastName, etc. So I began implementing my own custom Membership Provider. I created a derived MembershipUser class with the extra private variables that I wanted each MembershipUser record to store. Its basically done. Almost after I did this I stumbled across the columns in the ASPNETDB.MDF->aspnet_Profile table called "PropertyNames" and "PropertyValuesString".  Could I have simply used these two columns to accomplish what I was attempting to do or are these columns for global application configuration settings?  

Is the aspnet_Profile table purpose to store expanded/related information about users such as personal information? Or is it for something else? Thanks.

Adding additional fields to my custom membership provider

Hi, i have been playing around with the membership provider model for the last week and have it got it working with a basic table schema.  The trouble i have is that i wish to add an additional field (eg First Name) but am not sure how i can do this.  Here's what i have so far: public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)    {        MembershipUser user = new MembershipUser(Name, username, providerUserKey, email, passwordQuestion, null, isApproved, false, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now);        string sql = "INSERT INTO USERS(USERNAME,PASSWORD,EMAIL,ISACTIVE) VALUES(@UID,@PWD,@EMAIL,@ISACTIVE)";        db.AddParameter("@UID", username);        db.AddParameter("@PWD", password);        db.AddParameter("@EMAIL", email);        db.AddParameter("@ISACTIVE", (isApproved == true ? "Y" : "N"));        int i = db.ExecuteNonQuery(sql); 

Webshop Security - Membership provider useful?

Hello,I have to implement a small webshop. Basically it's just a website with a huge backend ERP System and with the possibility to sell one (yap, really only one!) product on the website. The only requirement is a MySQL Server. The backend is almost finished (about 95%) and is secured with the .net MemberShip Provider for MySQL (the one in MySql.Web from the MySql Connector .NET).Now to my question: I can set up the membership system easily but I do not need such things like username or password-question but I would need a reference to an address table to store the users home address. So, it is possible to change or customize the membership system to for eg. a unique customer id instead of the username column and set this in codebehind when the user is creating a new account? And is it possible to insert new users/customers from codebehind in an easy way? (I mean without checking each foreign key and inserting the customer reference to the userinrole table and so on...)Some tips appreciated.. :-)Thanks and regardsChris 

Planning common membership provider for different authentication providers

I am trying to implement form based authentication (FBA) membership provider that is able to support multiple authentication mechanisms. Take it as an self-training experiment. In this posting I will introduce bases of my experiment and introduce my current plans and ideas. Why membership provider for multiple authentication mechanisms? There are many people in the world who are users of some social network or some open services provider. Today Facebook and Twitter are very popular social networks. Also Google and Microsoft Live services are very popular although they are not social networks. But all mentioned systems provide their own authentication channels also to other applications. The question is: why should I have another username and password if I have already one at some of systems I mentioned before? Here, in Estonia, we are building local Microsoft community portal with local Microsoft. We analyzed the situation and decided to use Live ID as authentication mechanism in our portal. We were a little it worried too because we were afraid that there are load of users who are not happy with Live ID as authentication mechanism. And guess what - as time has shown us there is no reason to worry! Our ~2000 users (Estonia is small country) are all happy with Live ID and the ones who doesn't have Live ID yet can go and join Live ID - it's free. If you have no idea where I l

How To Customize membership provider in asp.net 3.5!!!

hello there,                  I have more problem in costomize membership provider, i did download  the code in c# from videos tutorial, that code have Membership provider class. but i am unable to use that class. how i will use it.  can help any one, if have any confussion in my question so plz ask i will clear it but i want custome membership provider.thank you pranayesh pathak

Membership migration from MS Access to MS SQL Server

Dear all,I want to migrate membership data table from Access to SQL Server but I got a problem about Data type.Do you know some topic what is related with it or somebody can did it?Thank you,

Custom Membership Provider Problem

Hi there, I'm writing a web app using C# and .NET 2.0 (corporate environment, so I can't use 4.0) and I'm running into an issue with custom membership providers. Everything compiles, and looks like it should work, but I get this error when viewing the WSAT Security tab:  Could not load type 'BinCSF.Security.CUser' from assembly 'App_Code.f4qdas9h, Version=, Culture=neutral, PublicKeyToken=null' <membership> section of web.config: http://illogi.ca/l/snippets/bincsf_web_config.html BinCSF.Security.UserProvider: http://illogi.ca/l/snippets/bincsf_userprovider.html BinCSF.Security.CUser: http://illogi.ca/l/snippets/bincsf_cuser.html Any help would be greatly appreciated.

MySQL Membership Provider issue

Hi all,I managed to set up the membership and roles providers for MySQL using the MySQL .NET Connector. I got the mysql tables for membership and roles autogenerated, managed to add users and roles from the Website Administration tool, but now I have a very strange problem: if I user the CreateUserWizard control (absolutely no customization - just dragged it to the webform) everything works fine. The user is created and I can see it in my mysql table.on the other hand I tried using the Login control to authenticate users and implemented the OnAuthenticate="Login1_Authenticate" event using the code below:protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)         {             if (FormsAuthentication.Authenticate(Login1.UserName, Login1.Password))             {                 Response.Redirect("Secret.aspx");             }             else             {                 e.Authenticated = false;             }         }protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)

ASP.NET 5.0: Multiple logins and login types in default ASP.NET membership provider

What do you think about an ability of having multiple logins and login types to be attached to the same user? Let me explain this by showing how database schema can be re-factored to support this model:Remove [Password], [PasswordSalt] columns from [Users] database tableAdd [Logins] table with one-to-many relationship between [Users] and [Logins] tablesThis will allow one user to have multiple credentials attached to his or her account of different types such as Username&Password, Windows Live ID, Open ID from different providersYou will be able to restrict allowed login types and OpenID providers in web.config So.. do you think it is a good idea to add support of this model into ASP.NET 4.5/5.0 membership service?http://aspnet.codeplex.com/workitem/7149

Custom membership provider and FormsAuthentication.

Hello folk, I've implemented my custom membership provider. I use third server for authentication (call web method that validates user/password). I need this user/password for retrieve some additional data from this server. Asp.net MVC uses FormsAuthentication and cookie for keep 'login state' by default. It works well when I login on site first time. But when I close and open site again sometime after, cookie keeps it 'login' but I don't have credential for access to server data. I can change cookieless attribute (to 'UseUri' for example) in configure file but in this case I should login again if I open second tab with this app in same browser. My questions: Is way to call SingOut of FormsAuthentication (remove authentication ticket from browser) when user closes asp.net mvc app?Is secure way to pass user/password data through session? Because server is unstable and interrupt connection often and app should have possibility for silent reconnect.

Migrating existing cleat text users password to hashed password Membership Provider

Hello all ,I had been trying to solve this but there is a hidden key i wish someone point me to.I had a simple membership database with users in first the Membership  Provider configured for clear passwordto retrieve the original password .Now a new requirement say that the password must be hashed and reset .I configure the Membership password to hash , and Implemented the Reset Password Module.My problem is as follow.If the user is new registered user with the new configuration the password and the security answer is hashed.also when I go and reset the password it continue to be hashed.Now I thought that with new configuration if any previous user with clear text configuration , If he use the password Reset module , because my configuration now is hashed , I expected that the new password  and security answer will be hashed  . what happen is old user continue in clear text even if the configuration is hashed.so If I had new users everything is fine.old users Membership Provider somehow know they had been stored in clear text and it keep change password and security answer in clear text .If I delete this user and create it , Membership Provider understand that everything will be hashed.I need to know how it know this , I need to migrate users not to delete and recreate users .If there is a solution for that kindly expl

Access SiteMap Provider

Hi I was trying to implement an access sitemap provider by taking this code: http://msdn.microsoft.com/en-us/library/ms178434.aspx Can one use this example without any further codings? In fact my testwebapp didn't work and I don't know now, if the code needs to be modified since I want to have the same kind of a provider as I have with the standard provider (xml file). Thanks for your advice.If you have a link with a fully functional access sitemap provider it would be great too. Patrick 

Membership Provider: Remove Secret Question .net 4.0

Im trying to remove the secret question / answer from the create user wizard control. I have removed the controls from the template but in previous versions of .net, you had to edit the web.config requiresecretquestion field to false.. I cant find this in the 4.0 web.config. When i try to add the Membership provider tag, i get an error saying its already added. Where is this being stored now? I cant seem to find it :(
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend