Results 1 to 9 of 9

Thread: Database Authentication

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    Database Authentication

    Can someone point me to a tutorial on how to authenticate a user against a database? Written in VB please!

    I dont want to use the config file to store user names and passwords...

    Please help

    Thanks!

    Anjari

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: Database Authentication

    It depends on how complicated you want to make it, but the easiest would be something along the lines of;

    Code:
    strSQLStatement = "SELECT * FROM tblUsers "
    strSQLStatement &= "WHERE strUserName = "
    strSQLStatement &= "'" & strSomeUserName & " '"
    strSQLStatement &= "AND strPassword = "
    strSQLStatement &= "'" & strSomePassword & " '"
    If you successfully retreive a record, then both the username and password match.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    Re: Database Authentication

    I just want to keep it simple... Im not going to be holding any top secret doccuments!! Could you expand the example a little bit for me? Please? I am still new... to the .net side..

    I just want to ck the user name and password against a data table and then use a session to block access to the pages..

    Anjari

  4. #4
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Re: Database Authentication

    Seems to me like plenderj gave you the info you need. What are you having troubles with? If it's the SQL part, there's plenty of online tutorials.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    Re: Database Authentication

    Gee Mike,

    Thanks for the OBVIOUS reply... Now had you of read my first posting you would notice in fact that was what I asked for to begin with...

    Thank you PenderJ for your assistance... I just need a little more help...

    and Mike... I am sorry if I offended you with my reply... I just find it counter productive for people to post comments like yours... If I understood the example that was given to me I would not have replied with a request for addiditonal information... I am sure there are plenty of people that have a grasp on this but as I stated I am new to .net and need more help..

    Anjari

  6. #6
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Re: Database Authentication

    Nah, I'm not offended, was actually trying to help. I wasn't trying to be a jerk or anything, was just wondering exactly what you're having trouble with. I can't point you to a tutorial, like you asked, but I do this type of coding all the time, so if you had a particular problem, I could probably help out.

    That's why I asked if it was the SQL part you're having trouble with. If you want, post the code you've tried so far and point out where you're having difficulty.

  7. #7
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Database Authentication

    Quote Originally Posted by Anjari
    Can someone point me to a tutorial on how to authenticate a user against a database? Written in VB please!

    I dont want to use the config file to store user names and passwords...

    Please help

    Thanks!

    Anjari
    This is an tutorial in asp not asp.net, using database. I am sure it will give you good idea how it works you should then be able to implement it in asp.net

    http://www.4guysfromrolla.com/webtech/021600-1.shtml

    Search the site for "Form Authentication" you should use that plus the DB for your authentication system. Thats the standard way of authentication user in asp.net.

    Hope it helps.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    Re: Database Authentication

    Thanks folks!!

    Just what I needed....

    Anjari

  9. #9
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Database Authentication

    Quote Originally Posted by Anjari
    Thanks folks!!

    Just what I needed....

    Anjari
    No worries

    4GuysFromRolla has some brilliant article on asp.net, do check them out if you get a chance you will learn a lot, i have .

    Happy learning...

    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width