472,353 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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
</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
6 2673

"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
OOPS!!!
i forgot to mention....
i am using ASP.NET with VB.NET...
can u pls help???
tks...
Jul 19 '05 #3
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
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: NickyW | last post by:
Hi, Can anyone help. I have a folder on my website that has 'anonymous access' and 'basic authentication' disabled, and requires 'intergrated...
3
by: Miranda johnsen | last post by:
Hello, I need some help with passing a value from my login authorization page. The authorization is done with the code below (it works), but I...
29
by: Thomas | last post by:
Hi I have an XSL stylesheet: <xsl:for-each select="TRACKS/TRACK"> <tr class="TDL"> <td width="90%"><xsl:number value="position()" format="1"...
11
by: Bazza Formez | last post by:
Hi, I have an app which utilizes forms security. I have a Login.aspx page which references my MasterPage.master. The master page in turn...
0
Savage
by: Savage | last post by:
I'm making for fun a simple program which format a input file.Input file sustain of person name,lastname and date of birth.Output file si supposed...
0
by: sandy | last post by:
hello,,,,,,,,, i am creating login page using Perl/CGI facing prob... able to connect DB but from there facing prob If u have related code of...
2
by: mnacw | last post by:
Can anybody help me to resolve this prob. i have installed Visual Studio 2005 Professional edition. I am working in VB.Net. When I tried to connect...
2
by: praveenkhade | last post by:
hi sudhanva I got a prob in my project. wen i login to web site, the default.aspx wil be displayed. In this page a Link Button is there(in which...
3
by: metalheadstorm | last post by:
hi there, im currently writing a program in vb6 that will eventually be able to retrieve data from an online xml sheet it will have a user base...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.