473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 2733

"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 Windows authentication'. This used to work fine, but...
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 need the 'uName' value passed on when the...
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" /> - <xsl:value-of select="TRACKTITLE"/></td>...
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 references a css. In the designer of VS 2005, the...
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 to be forammted as following: NAME ...
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 login page in Perl please send me on...
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 to database it is connected but when i make some...
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 confidential documents are there), wen i click this...
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 where each user has its own xml sheet and that only...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.