none
Change password for a secured access database RRS feed

  • Question

  • I am accessing an access database using the following connection string:

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=S:\45_PBSPerformance\PBSData2003.mdb;Persist Security Info=True;Encrypt Password=False;Password=;User ID=NewUser;Jet OLEDB:System database=S:\45_PBSPerformance\TC.mdw

    I need to assign a password to this new user but I cannot find the proper command.

    I am using ALTER PASSWORD NULL TO 'something' this is the actual function:

     

    Dim OleDbCmd As OleDbCommand = Nothing

     

    If oCnn.State = ConnectionState.Closed Then oCnn.Open() 'Open connection

     

    Dim strSQL As String = "ALTER PASSWORD NULL TO '" & Me.txtPassword.Text & "'"

     

    Dim oOledDbCmd As New OleDbCommand(strSQL, oCnn)

     

    Dim recAffected As Integer = oOledDbCmd.ExecuteNonQuery()

    It does not work and I dont want to use dao object.

    • Moved by Bessie Zhao Monday, October 4, 2010 6:49 AM It is a ADO.NET issue and not related to be VSTO technologies. (From:Visual Studio Tools for Office)
    Sunday, October 3, 2010 2:13 PM

Answers