|
-
Dec 5th, 2004, 04:31 PM
#1
Thread Starter
Hyperactive Member
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
-
Dec 6th, 2004, 05:16 AM
#2
Retired VBF Adm1nistrator
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]
-
Dec 6th, 2004, 11:23 AM
#3
Thread Starter
Hyperactive Member
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
-
Dec 6th, 2004, 01:29 PM
#4
Frenzied Member
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.
-
Dec 7th, 2004, 03:04 PM
#5
Thread Starter
Hyperactive Member
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
-
Dec 7th, 2004, 03:12 PM
#6
Frenzied Member
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.
-
Dec 7th, 2004, 05:03 PM
#7
Re: Database Authentication
 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 : 
-
Dec 7th, 2004, 08:33 PM
#8
Thread Starter
Hyperactive Member
Re: Database Authentication
Thanks folks!!
Just what I needed....
Anjari
-
Dec 7th, 2004, 09:07 PM
#9
Re: Database Authentication
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|