Please Help (VB) 
Author Message
 Please Help (VB)

I have written a simple script that checks for a UserName and Password
inside
a access database to restrict access.  I have tried repeatedly to add to
it.
I am trying to also check for the date.  Not just the date but if the
current
date (date()) is less than the specified EXP_DATE which is another field in
the database.  I suppose it would look similar to ... 'if Date() <
EXP_DATE.
What I can't figure is how to put it all together.

Thanks in advance



Tue, 06 Mar 2001 03:00:00 GMT  
 Please Help (VB)
OK, do this:

SQL = "Select * From Users where UserID = '" & UserID & "' "
Set RS1 = DB.OpenRecordset(SQL, DBOpenDynamic)

If RS.EOF Then 'no records to be found.
    MsgBox "You are not allowed in because your username was not found."
End If
If RS1.Fields("Password") <>  sPassword Then
    MsgBox "You password is incorrect. Please try again."
End If
If CDate(RS1.Fields("EXP_Date")) < Date() And EXP_Date <> "Unlimited" Then
    MsgBox "You password has expired. Please contact an administrator to
change your password."

Hope this helps.
--
Chris Stamey
-------------------
http://www.Farther.com/VBAnswerNetwork

I have written a simple script that checks for a UserName and Password
inside
a access database to restrict access.  I have tried repeatedly to add to
it.
I am trying to also check for the date.  Not just the date but if the
current
date (date()) is less than the specified EXP_DATE which is another field in
the database.  I suppose it would look similar to ... 'if Date() <
EXP_DATE.
What I can't figure is how to put it all together.

Thanks in advance



Wed, 07 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Please help....VB & SPSS

2. please help: VB app with ADODC won't work at Win98

3. !!!Please help vb student!!!

4. Please help (VB problems)

5. Please Help - VB 4.0 and MSAccess

6. Please Help: VB Object

7. Please Help.....VB has turned German

8. !!!Please help vb student!!!

9. Please Help : VB and CDROM

10. detecting a busy signal with mscomm,please help vb 3

11. Please Help - VB Installation

12. Please help: VB and Netware

 

 
Powered by phpBB® Forum Software