Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2011, 06:33 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default Checking A Date Before allowing user log in

I have a password form that prompts the user to input their user name and password before they can log in. I need the vba code that checks the expiry date of the user's account before the user can login

Regards
__________________
Brendan Bartley
 
Old April 5th, 2011, 10:48 AM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

How are you checking the user name and password?

How do you determine the expiry date?
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old April 6th, 2011, 05:25 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using the following code when user types their user name I now need that when this is done is checks an expiry date and if the accont is locked

Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Dim prm As DAO.Parameter
Dim rst As DAO.Recordset
Dim sSQL As String
sSQL = "SELECT * FROM tblAssociate WHERE UserID = '" & Me.txtUser & "'"

Set dbs = CurrentDb()
Set qdf = dbs.CreateQueryDef("", sSQL)
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rst = qdf.OpenRecordset

Me.txtPassword = rst!Password

'clean up
rst.Close
Set rst = Nothing
qdf.Close
Set qdf = Nothing
Set dbs = Nothing
__________________
Brendan Bartley
 
Old April 6th, 2011, 11:35 AM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

Quote:
... I now need that when this is done is checks an expiry date and if the accont is locked
Is this information stored in the tblAssociate table?

What expiry information is stored?

What account locked status is stored?
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015

Last edited by HiTechCoach; April 6th, 2011 at 12:28 PM..
 
Old April 6th, 2011, 12:06 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

all fields are located in the tblassociate table
__________________
Brendan Bartley
 
Old April 6th, 2011, 12:26 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

You are not giving me much to work with here.

Code:
SELECT * FROM tblAssociate
This only tells me the table name not the field name you are retrieving.

Since I have not seen your database and you have not given an details on the table structure I have no clue what is stored in your tables. I have no idea what fields you have in the table tblAssociate. Or what type of data is store in each field.

You may have all the information you need in the rst recordset.

You can reference the other fields like you do the password using rst!Password.


How exactly do you determine expiry date?

How exactly do you determine account lock status?
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015

Last edited by HiTechCoach; April 6th, 2011 at 12:31 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Type checking NEO1976 XSLT 5 February 1st, 2007 10:37 AM
Checking the contents of a text file for log-in Seifer Classic ASP Basics 10 December 18th, 2006 12:45 PM
Checking Security Event log for failed logins Ronb722 VBScript 2 September 29th, 2004 10:04 AM
Checking User validity kumar_sampath Pro JSP 2 September 12th, 2004 04:12 PM
checking user input hosefo81 Javascript How-To 0 February 16th, 2004 11:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.