×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ADP & sp_password problesm

ADP & sp_password problesm

ADP & sp_password problesm

(OP)
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:

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
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

RE: ADP & sp_password problesm

What is the code of the Stored Procedure

RE: ADP & sp_password problesm

(OP)
Stored procedure is the 'standard' M$ stored procedure sp_password (Expects 3 variables @Old, @New & @loginame - @old & @loginame can be null)

CODE

create procedure sp_password
    @old sysname = NULL,        -- the old (current) password
    @new sysname,               -- the new password
    @loginame sysname = NULL    -- user to change password on
as
.
.
.

RE: ADP & sp_password problesm

(OP)
OK, found an answer in one of my (multitude of) Access books at home last night.  For info it looks like this:

CODE


With cmd
    .ActiveConnection = cnn
    .CommandType = adCmdStoredProc
    .CommandText = "master.dbo.sp_password"
    .Execute Parameters:=Array(oldpass, newpass, sqllogin)
End With

The quick test I ran (with an incorrect old password) returned a sensible (ie in English) error message.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close