473,394 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Changing SQL Server 2000 Password

I'm using VS2005/2.0 Framework.

The SQL Server I was working with is MS SQL 2000. I don't know what
build off hand.

I tried to make a small web form to change the password, using this code:

Dim strCTID As String = txtClaimTrakID.Text
Dim strPassword As String = txtCurrentPassword.Text
Dim strNewPassword As String = txtNewPassword.Text
Dim strNewPassword2 As String = txtNewPassword2.Text

Dim strConnection As String
strConnection = "server=sql;database=master;integrated " & _
"security=false;uid=" & strCTID & ";pwd=" &
strPassword

Try
If strNewPassword = strNewPassword2 Then
SqlConnection.ChangePassword(strConnection, strNewPassword)
Else
Response.Write("New Passwords Did Not Match")
End If
Catch ex As Exception
Response.Write(ex.ToString)
End Try

The error I got back was this:

System.InvalidOperationException: ChangePassword requires SQL Server 9.0
or later. at System.Data.SqlClient.SqlConnection.ChangePassword (String
connectionString, String newPassword) at
tests_sqlpasswordchange.btnConnect_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\tests\sqlpasswordchange.aspx.vb :line 22

So, my question is, is there some other method I can use to get the job
done in this manner?

TIA,
Jim
Oct 12 '06 #1
2 1797
If strNewPassword = strNewPassword2 Then
SqlConnection.ChangePassword(strConnection,
strNewPassword)
Else

System.InvalidOperationException: ChangePassword requires SQL Server 9.0
or later. at System.Data.SqlClient.SqlConnection.ChangePassword (String
So, my question is, is there some other method I can use to get the job
done in this manner?

Yes.
1. Connect to the database as database owner (or somebody with enough
permissions). Get into database master.
2. Execute stored procedure sp_password. Example:

exec sp_password 'old_Pass', 'new_Pass', 'user_name'

Do a Google Search for "sp_password".. it's a T-SQL command.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
-----------------------------------------
Oct 13 '06 #2
Gaurav Vaish (www.EdujiniOnline.com) wrote:
> If strNewPassword = strNewPassword2 Then
SqlConnection.ChangePassword(strConnection,
strNewPassword)
Else

System.InvalidOperationException: ChangePassword requires SQL Server 9.0
or later. at System.Data.SqlClient.SqlConnection.ChangePassword (String
>So, my question is, is there some other method I can use to get the job
done in this manner?


Yes.
1. Connect to the database as database owner (or somebody with enough
permissions). Get into database master.
2. Execute stored procedure sp_password. Example:

exec sp_password 'old_Pass', 'new_Pass', 'user_name'

Do a Google Search for "sp_password".. it's a T-SQL command.

Ah. Ok. I didn't even think of going that route.

Thanks.
Oct 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Terri | last post by:
When I make change in the Connection screen in an adp I get the message "Your password will not be encrypted before it is saved to the file. Users who view the source contents of the file will be...
2
by: fatboy | last post by:
I'm trying to change the database and server on a report that was created using integrated security e.g. report was created pointing to the server 'testserver' and database 'testdb' and at runtime...
2
by: Petr PALAS | last post by:
Hi, when I open ANY ASP.NET application on my computer I get this message: ---------------------------------------------------------------------------- ---- Server Application Unavailable ...
5
by: Ken Cox [Microsoft MVP] | last post by:
MS has posted this here: http://www.asp.net/faq/ms03-32-issue.aspx Fix for: 'Server Application Unavailable' Error after Applying Security Update for IE...
1
by: Reza Sadeghi | last post by:
Hi I am getting this error when I tried to browse any asp.net in visual studio.net. I can build the project but when I try to run and debug the project I get error message that "Unable to start...
3
by: sammyloo | last post by:
Hi all, I'm experiencing a problem using ASP.NET web services to access a different server with SQL Server 2000 database. And I get the error of the following Exception Details:...
14
by: c676228 | last post by:
Hi everyone, Our site is down, because of our hosting company applied sql server 2000 sp4 on windows 2000 server. right after it applied the service pack, our sql server database is down and...
5
by: OJ | last post by:
Hi, I am at a loss here, I have a c# asp.net website which connects to a remote SQL Server 2000 db via a connection string. If I set the website up in the filesystem and use the inbuilt cassini...
4
by: John Kotuby | last post by:
Hi all, I have a simple user-form which accepts contact and profile information for the user to edit and save. All the textboxes are working fine and displaying the expected data, both when the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.