I'm creating an ADP & internal audit want me to force users to update their passwords periodically. I'm having problems on two fronts. Firstly, the VBA to send the information to sp_password keeps giving me the error
"Procedure 'sp_password' expects parameter '@new', which was not supplied."
Here's the code (VBA) I'm using:
I've tried using .parameters(1) etc but get the same result.
Second question - how can I check if the change has been succesful. I see sp_password returns 0 but how can I get at that value to check? I can then inform the user?
Thanks in advance.
Richard
"Procedure 'sp_password' expects parameter '@new', which was not supplied."
Here's the code (VBA) I'm using:
Code:
Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Set cnn = CurrentProject.AccessConnection
.
.
.
With cmd
.ActiveConnection = cnn
.CommandType = adCmdStoredProc
.CommandText = "master.dbo.sp_password"
.Parameters.Refresh
.Parameters("@old").Direction = adParamInput
.Parameters("@old") = oldpassword
.Parameters("@new").Direction = adParamInput
.Parameters("@new") = NewPassword
.Parameters("@loginame").Direction = adParamInput
.Parameters("@loginame") = mytestlogin
.Execute
End With
Second question - how can I check if the change has been succesful. I see sp_password returns 0 but how can I get at that value to check? I can then inform the user?
Thanks in advance.
Richard