473,789 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EventArg s) Handles cmdFilter.Click

Dim strUserID As String = txtUserID.Text
Dim strPwd as string
Dim conn As OleDbConnection
Dim dsn As String =
ConfigurationSe ttings.AppSetti ngs("Connection String")

conn = New OleDbConnection (dsn)

Try
Dim da As OleDbDataAdapte r
da = New OleDbDataAdapte r("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 2756

"josephrtho mas" <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.EventArg s) Handles cmdFilter.Click

Dim strUserID As String = txtUserID.Text
Dim strPwd as string
Dim conn As OleDbConnection
Dim dsn As String =
ConfigurationSe ttings.AppSetti ngs("Connection String")

conn = New OleDbConnection (dsn)

Try
Dim da As OleDbDataAdapte r
da = New OleDbDataAdapte r("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("u serid")
Password = Request.Form("p swd")

set conn = server.CreateOb ject ("ADODB.Connect ion")
conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=blah blah blah.mdb"

set rs = server.CreateOb ject ("ADODB.Records et")
'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.Redire ct("login.asp?l ogin=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.Redire ct("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.Redire ct("login.asp?l ogin=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
"JosephRTho mas" <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.publi c.dotnet.framew ork.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******@NOyah oo.SPAMcom> wrote in message
news:ui******** ******@TK2MSFTN GP10.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.publi c.dotnet.framew ork.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
1958
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 all of a sudden it won't let me in! . The login box appears, I have checked the username, password and domain are fine (I can still log directly in to the server with them) but I can't get access! and after I've tried 3 times I just get redirected...
3
2451
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 window.location is activated. I code my ASP with JavaScript NOT vbscript so please no &'s. And yes I know I should be using a DSN-less connection! ((sorry, everytime I post I get blasted about my syntax and connection choice :+))
29
5743
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> <td width="10%" align="center"><a href="{TRACKURL}" target="_blank">More info!</a></td>
11
3879
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 Login page renders correctly.... with correct formatting as provided by my css. At application runtime however, all formatting disappears on the login
0
1406
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 LASTNAME DATE OF BIRTH And i finished it but there is little prob: it don't output date of birth! I thinkt about the prob and can't figure out why is that happening. To output data i used function: void output(void),i have...
0
6498
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 sandip.bhosale@gmail.com please help me i am using MySQL as DB user name:root password:root database name:ITS
2
1519
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 changes in table and try to update it does not work. It does not give any error. It seems like all fine. but when I retrieve the data via application menas data grid control on form. shows only previous data. no updates. i am using acess...
2
939
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 button it should show login page again, so dat authorized person should open it. The username is in session. I redirected it then same cyclic process is going on ( again i login if click link button again login) wat to do?? protected void...
3
1494
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 them (via username and password) will be able to access it and reads so each user will have its own directory like site.com/user1/values.xml. im not that strong on the web side and have only really done simple html sites, is ther an...
0
9665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6768
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.