By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,672 Members | 1,628 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,672 IT Pros & Developers. It's quick & easy.

login prob

P: n/a
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
</code>
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
Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a

"josephrthomas" <ex***********@yahoo.com.sg> wrote in message
news:03****************************@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
</code>
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


I have a form on one page (login.asp) that takes two values, userid and pswd

these are then sent to a verify page with the following code

Username = Request.Form("userid")
Password = Request.Form("pswd")

set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=blah blah blah.mdb"

set rs = server.CreateObject ("ADODB.Recordset")
'Open record with entered username
rs.Open "SELECT * FROM users where name='"& Username &"'", conn, 1

'If there is no record with the entered username, close connection
'and go back to login with message that user doesn't exist

If rs.recordcount = 0 then
rs.close
conn.close
set rs=nothing
set conn=nothing
Response.Redirect("login.asp?login=namefailed")
end if

'If entered password is right, close connection and open mainpage
if rs("password") = Password then

rs.Close
conn.Close
set rs=nothing
set conn=nothing
Response.Redirect("default.asp")

'If entered password is wrong, close connection
'and return to login with message that password is wrong

else
rs.Close
conn.Close
set rs=nothing
set conn=nothing
Response.Redirect("login.asp?login=passfailed")
end if

%>
Jul 19 '05 #2

P: n/a
OOPS!!!
i forgot to mention....
i am using ASP.NET with VB.NET...
can u pls help???
tks...
Jul 19 '05 #3

P: n/a
oops..sorry..I was using plain ol' asp
"JosephRThomas" <ex***********@yahoo.com.sg> wrote in message
news:03****************************@phx.gbl...
OOPS!!!
i forgot to mention....
i am using ASP.NET with VB.NET...
can u pls help???
tks...

Jul 19 '05 #4

P: n/a
JosephRThomas wrote:
OOPS!!!
i forgot to mention....
i am using ASP.NET with VB.NET...
can u pls help???
tks...


This is a classic asp newsgroup. While you may be lucky enough to find a
dotnet-savvy person here who can answer your question, you can eliminate the
luck factor by posting your question to an appropriate group. I suggest
microsoft.public.dotnet.framework.aspnet. (the key word is dotnet)

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #5

P: n/a

"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:ui**************@TK2MSFTNGP10.phx.gbl...
JosephRThomas wrote:
OOPS!!!
i forgot to mention....
i am using ASP.NET with VB.NET...
can u pls help???
tks...
This is a classic asp newsgroup. While you may be lucky enough to find a
dotnet-savvy person here who can answer your question, you can eliminate

the luck factor by posting your question to an appropriate group. I suggest
microsoft.public.dotnet.framework.aspnet. (the key word is dotnet)

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

I got all excited for a moment cos I had actually been able to answer
someones question instead of always asking them...thought I was making
progress!!

Jul 19 '05 #6

P: n/a
Alistair wrote:
I got all excited for a moment cos I had actually been able to answer
someones question instead of always asking them...thought I was making
progress!!


You were!

Bob

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.