473,574 Members | 18,274 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 2747

"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
1947
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...
3
2443
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!...
29
5721
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
3863
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
1397
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...
0
6463
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
1513
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...
2
933
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...
3
1488
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 ...
0
8081
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. ...
0
8258
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7835
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...
0
8121
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...
0
5325
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...
0
3759
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3777
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2255
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
0
1084
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.