Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,188 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,136 people online right now. Registration is fast and FREE... Join Now!




user log in w/ database in a time monitoring system

 
Closed TopicStart new topic

user log in w/ database in a time monitoring system

emkaye
19 Aug, 2007 - 08:51 AM
Post #1

D.I.C Head
**

Joined: 12 Aug, 2007
Posts: 54


My Contributions
hi there! i needed this urgently...i've already posted a topic entitled time monitoring system.i've seen that there are already some who viewed my topic yet i still haven't received any replies. i guess is should break down my topic little by little for I know I can't get results that fast.

My time monitoring system includes a user login form where the employees will need to enter their Employee ID and password. As you can see this time monitoring system includes multiple users, having different passwords. I am using MSAccess.

Here is my code for my user log in

CODE

Private Sub cmdOK_Click()

With myRS

         If txtEmpID = .Fields(0) And txtPassword = .Fields(1) Then
         Form2.Show

         ElseIf txtEmpID <> .Fields(0) And txtPassword <> .Fields(1) Then
         MsgBox ("invalid user")

         End If
         End If

End With

End Sub



Is my code right?

I have only two records in my database:

EMPID PASSWORD
AD001 maintenance
DE004 employee

When I enter AD001 w/ the "maintenance" password, Form2 shows. But when I enter the second user DE004 w/ the "employee" password, "Invalid user" appears.

I was just wondering why is this happening. Why would employee DE004 became invalid if it was one of the records in my database?

I've tried adding a new record AA001 w/ the "administrator" password. When I once again entered employee AD001, this time Form2 was not shown,instead "Invalid user" appears. When I entered employee AA001(my new added record), Form2 shows.

What I see here is, only the record in the first row of my table works...

Please help...

Thanks
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: User Log In W/ Database In A Time Monitoring System
19 Aug, 2007 - 11:37 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
You've already posted a post with this SAME EXACT code and question. Do NOT double post! please smile.gif
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: User Log In W/ Database In A Time Monitoring System
22 Aug, 2007 - 08:57 AM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,906



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Topic Closed.
User is offlineProfile CardPM
+Quote Post

Closed TopicStart new topic
Time is now: 12/2/08 01:20AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month