PDA

Click to See Complete Forum and Search --> : Database Authentication


Anjari
Dec 5th, 2004, 03:31 PM
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 :D

Thanks!

Anjari

plenderj
Dec 6th, 2004, 04:16 AM
It depends on how complicated you want to make it, but the easiest would be something along the lines of;


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.

Anjari
Dec 6th, 2004, 10:23 AM
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

Mike Hildner
Dec 6th, 2004, 12:29 PM
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.

Anjari
Dec 7th, 2004, 02:04 PM
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

Mike Hildner
Dec 7th, 2004, 02:12 PM
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.

Danial
Dec 7th, 2004, 04:03 PM
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 :D

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.

Anjari
Dec 7th, 2004, 07:33 PM
Thanks folks!!

Just what I needed....

Anjari

Danial
Dec 7th, 2004, 08:07 PM
Thanks folks!!

Just what I needed....

Anjari

No worries :thumb:

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

:wave: