Ask a Question related to ASP Database, Design and Development.
-
josephrthomas #1
login Prob
hi..i am trying to make a login page and i am using access
table..
when the user enters his userid and password i want to
check the password from the table..
if any user with the userID that is entered exists i want
to find the correspoding password for him else i want to
throw an error saying no such user exists..
i know how to access the MS Access table and stuff..but
now what i want to do is to take the userid and see if
there is any userid such as the one existing, and if there
is i want to take out the password for that user ID..
what i am trying to do is as below.
The prob is, once i get the data in the dataset, how do i
take out the password??
i mean is there is any way i can assign the derieved
password to strPwd???
<code>
Private Sub cmdLogin_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cmdFilter.Click
Dim strUserID As String = txtUserID.Text
Dim strPwd as string
Dim conn As OleDbConnection
Dim dsn As String =
ConfigurationSettings.AppSettings("ConnectionStrin g")
conn = New OleDbConnection(dsn)
Try
Dim da As OleDbDataAdapter
da = New OleDbDataAdapter("Select
[Password] from Customer where UserID ='" & strUserID
& "'", conn)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "Customer")
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@
'HOW TO GET THE PASSWORD FROM THE
DATASET?????????????
'HOW TO ASSIGN THE PASSWORD IN THE DATASET
TO STRING strPwd???????
'strPwd = ???????????????
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@
Finally
conn.Dispose()
End Try
End Sub
*****************************************
can someone pls help me out????
is there any way i can take out the password that is
stored in the dataset and assign it to strPwd??
also how do i know that the userID could not be found in
the database and the dataset has nothing stored inside so
that i can tell the user that NO SUCH USER EXISTS!
can someone pls help me....
tks a lot...
any help deeply appreciated..
tks
josephrthomas Guest
-
Strange problem with Forms authentication: After successfull login, login page is still displayed
Hi there I have a quite strange problem with my ASP.NET-Application. The application has being deployed one year ago and worked fine till last... -
PROB!PLEASE HELP
Hi all, When I test my flashmx2004 videoconf. application it just very briefly shows the login menu and the it stops and nothing is displayed.... -
session problem - login screen continually reloads after pressing the login button
I am trying to get sessions to work on a log in screen to give certain users access to certain pages/directories. The problem is that when the... -
can't login! - authentication prob.
Hi, Can anyone help. I have a folder on my website that has 'anonymous access' and 'basic authentication' disabled, and requires 'intergrated... -
LOGIN: ERROR- Failed to initialize policy manager. (IFOR_PM_FATAL) Login sessions denied.
Verify that you haven't set the system date by mistake to a far away future. All the licenses then become expired! Restoring the system to the... -
Alistair #2
Re: login Prob
already answered. Please DO NOT multipost
"josephrthomas" <extremedotnet@yahoo.com.sg> wrote in message
news:041601c3cdd3$737c5ef0$a301280a@phx.gbl...> hi..i am trying to make a login page and i am using access
> table..
> when the user enters his userid and password i want to
> check the password from the table..
>
> if any user with the userID that is entered exists i want
> to find the correspoding password for him else i want to
> throw an error saying no such user exists..
>
> i know how to access the MS Access table and stuff..but
> now what i want to do is to take the userid and see if
> there is any userid such as the one existing, and if there
> is i want to take out the password for that user ID..
>
> what i am trying to do is as below.
>
> The prob is, once i get the data in the dataset, how do i
> take out the password??
>
> i mean is there is any way i can assign the derieved
> password to strPwd???
> <code>
> Private Sub cmdLogin_Click(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles cmdFilter.Click
>
> Dim strUserID As String = txtUserID.Text
> Dim strPwd as string
> Dim conn As OleDbConnection
> Dim dsn As String =
> ConfigurationSettings.AppSettings("ConnectionStrin g")
>
> conn = New OleDbConnection(dsn)
>
> Try
> Dim da As OleDbDataAdapter
> da = New OleDbDataAdapter("Select
> [Password] from Customer where UserID ='" & strUserID
> & "'", conn)
>
> Dim ds As DataSet = New DataSet()
> da.Fill(ds, "Customer")
> '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@
> 'HOW TO GET THE PASSWORD FROM THE
> DATASET?????????????
> 'HOW TO ASSIGN THE PASSWORD IN THE DATASET
> TO STRING strPwd???????
> 'strPwd = ???????????????
> '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@
> Finally
> conn.Dispose()
> End Try
> End Sub
> *****************************************
> can someone pls help me out????
> is there any way i can take out the password that is
> stored in the dataset and assign it to strPwd??
> also how do i know that the userID could not be found in
> the database and the dataset has nothing stored inside so
> that i can tell the user that NO SUCH USER EXISTS!
> can someone pls help me....
> tks a lot...
> any help deeply appreciated..
> tks
>
>
Alistair Guest
-
Bullschmidt #3
Re: login Prob
And here are a few felated issues about login pages on a Web site.
Perhaps have a login page that asks the user for his username and
password. And whatever page that posts to (which could be the same page
for a self posting form) tests these fields against what is in the
database, sets the username and userlevel session variables accordingly,
and then redirects to the proper page - i.e. back to the login page if
the password is wrong (perhaps with a JavaScript popup saying wrong
username/password combination) or to the main menu page if the password
is correct:
Session("UserName") = objRS("UserName")
Session("UserLevel") = objRS("UserLevel")
Response.Redirect "mainmenu.asp"
Then you can use If Then's or Select Case on each page to control
whether a user is allowed to actually be there and whether particular
links of where a user can go actually show up.
If (Session("UserLevel") <> "Admin") And (Session("UserLevel") <>
"Regular") Then
Response.Redirect "login.asp"
End If
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
[url]http://www.Bullschmidt.com[/url]
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Bullschmidt Guest



Reply With Quote

