Bonjour � tous,

je voudrai �x�cuter la fonction de changement de mot de passe : http://access.developpez.com/faq/?page=user#ChangerMDP
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
 
With DBEngine.Workspaces(0)
 .Users(.UserName).NewPassword "ancienmotdepasse", "nouveaumotdepasse"
End With
cette fonction marche tr�s bien utilis� dans ACCESS. Mais je voudrai l'appeller dans du C#.

J'ai essay� d'utiliser deux m�thodes et aucune des deux ne fonctionnent.

1)
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
 
     string Conn = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:/toto.mdb; Jet OLEDB:System Database=c:/toto.mdw; User Id="+login+"; Password="+PWD+";";
     System.Data.OleDb.OleDbConnection Con = new OleDbConnection(Conn);        
 
     System.Data.OleDb.OleDbCommand Cmd = new OleDbCommand(Request, Con);
 
     Con.Open();
     OleDbDataReader dr = Cmd.ExecuteReader();
     Con.Close();
Cela ne marche je ne peux qu'�x�cuter du SELECT, INSERT, UPDATE ou DELETE.

2)
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
           string Conn = @"c:/toto.mdb";
 
            Acc.OpenCurrentDatabase(Conn, false, "");
 
            object oMissing = System.Reflection.Missing.Value;
            string P1 = login;
            Object P2 = P1;
            string P3 = oldPWD;
            Object P4 = P3;
            string P5 = NewPWD;
            Object P6 = P5;
 
 
            Object o = Acc.Run("ChangePWD", ref P2, ref P4, ref P6, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
 
            Acc.CloseCurrentDatabase();
            Acc.Quit(Access.AcQuitOption.acQuitSaveNone);
et l� je peux �x�cuter d'autre fonction mais pas celle-l�!

pourquoi?

merci d'avance pour votre aide.

Cordialement.
ALCINA.