How to set password newly install Sql server 2005 by query?

  • Hi,

    I'm using Vb6.0

    Database : SQL Server 2005.

    In my vb6.0 installation file, add sql server 2005 and install automatically if not already installed.

    sqlserver installation is installed properly when my software installation.No issues in Sql server 2005 installation.

    Additional info: I install this exe file sql server 2005 "SQLEXPR.EXE"

    here I have a question.

    After install sql server 2005, how to reset or change the password for "sa"? At this stage, "sa" have no password.this is newly install sql server2005.so user have to set password.

    I want to do this reset password by automatically using query.because user have no knowledge about the Sql server and settings.

    How can I achieve this?

    I guess explain clearly, if not please let me know.

    Thanks in advance,

    thenndral

  • I guess this should work (when you are logged in as the SA):

    USE [master]

    GO

    ALTER LOGIN [sa] WITH PASSWORD=N'new_password'

    GO

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • Thanks HanShi.

    I didn't install "Sql Server Management Studio Express" because user no need use.

    could you tell me, where can I run this query?

    Please explain me, little more detail.

    I check this code in query window, It is working well but user have no knowledge how to use query window and setting password.

    USE [master]

    GO

    ALTER LOGIN [sa] WITH PASSWORD=N'new_password'

    GO

    Thanks Again,

    thenndral

  • From your VB6 you allready install the SQL instance. You could add some additional code to create an ODBC connection when the installation is finished. Next you execute the SQL-code from within your VB6 code over the ODBC connection. No user action needed ;-).

    I found a quick sample over here: http://www.connx.com/products/connx/connx%208.6%20userguide/CONNXCDD32C/Sample_Visual_Basic_ODBC_Application.htm

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply