[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How can I determine from my vb app if my sybase password has expired

Posted on 2004-08-12
5
Medium Priority
?
228 Views
Last Modified: 2006-11-17
I need to be able to update my password on sybase, from my vb application, when it has expired. Something similar to the way the nt login works i.e. a few days before it is due to expire, when you logon you are asked if you would like to change it. You type in the old and new one and then it is updated

I know within sybase you can run the following to do the update

                      EXEC sp_password 'oldPassword', 'newPassword', 'loginName'

How can I tell if the password has expired or is there anywhere that I can set a flag to i.e. if its the last day of the month prompt the user that they need to change their password
0
Comment
Question by:INDYND
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 11798142
Sorry, I don't use or have access to Sybase so I can't answer the portion of your post about how to tell if the password has expired.  I can provide a sample, actually two samples, of ways to prompt the user to change their password at the end of the month.  The first sample tests to see if today's date is within x, I used 7 as an example,  days of the end of the month.  If it is, then it displays a dialog box advising the user that it's time to think about changing their password.  The second example is essentially the same as the first, but returns the number of days to the end of the month.  This allows for a dialog box like the one in Windows that reminds the user each day that their password expires in x days.  


    If PWExpirationNoticeA(Date, 7) Then
        MsgBox "Password expires within 7 days."
    End If
   
    intdaystillexpiration = PWExpirationNoticeB(Date)
    If intdaystillexpiration <= 7 Then
        MsgBox "Your password expires in " & intdaystillexpiration & " day(s)."
    End If

Public Function PWExpirationNoticeA(datDate As Date, intDaysInAdvance As Integer) As Boolean
    'Checks to see if the date passed is within a certain number of days of the end of the month.
    'Returns True if it is.
    Dim datEOM As Date
    datEOM = datDate + DateDiff("d", datDate, DateAdd("m", 1, datDate)) - Day(datDate)
    PWExpirationNoticeA = (DateDiff("d", datDate, datEOM) <= 7)
End Function

Public Function PWExpirationNoticeB(datDate As Date) As Integer
    'Calculates the number of days between the date passed and the end of the month for the date passed.
    'Returns the number of days difference.
    Dim datEOM As Date
    datEOM = datDate + DateDiff("d", datDate, DateAdd("m", 1, datDate)) - Day(datDate)
    PWExpirationNoticeB = DateDiff("d", datDate, datEOM)
End Function
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12398498
I held off on posting a recommendation in the hopes that Indynd would finalize the question.  In the absence of that I recommend accepting my answer (http:#11798142).
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question