how to run sp_password? ** Urgent**

M

Me

I want to run the sql server procedure sp_password to
change the sql server database password for logged on user.
How can I do it?

I tried using DoCmd.RunSQL SQL

where SQL = EXEC sp_password NULL, 'newpwd', 'username'

but it seems it won't accept statements other than 'SELECT/INSERT/UPDATE/ or
the like thereof'

Thank you,
-Me
 
T

TonyT

Where are you trying to run it from? the SQL server itself or a front end? It
should be on the server itself I beleive.

TonyT..
 
M

Me

Tony,

I am trying to run it from within access form. I can run it directly on the
server. But
I have to roll it out to users, that's why I need it this way.

Thank you,
-Me
 
T

TonyT

I'm sure I've seen a procedure to do that in microsoft kb articles I can't
find it now on sp_password, but there are lots of other articles, maybe it is
referenced in 1 of them, sorry not to be of more help, try reposting to get
better chance of response, some ppl won't read if many replies already,

good luck

TonyT..
 
V

Van T. Dinh

I don't think you can use DoCmd.RunSQL as this method is executed by JET,
not SQL Server.

All you have to do is to set up a Connection object to the SQL Server and
then use the Execute method of the Connection object to run the SQL.

Alternatively, you can create a Pass-Through Query and then use the Execute
method of the (current) Database object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top