Click here to Skip to main content
15,922,145 members
Home / Discussions / C#
   

C#

 
GeneralRe: Simple XML browser Pin
clatten17-Aug-04 4:10
clatten17-Aug-04 4:10 
GeneralADOCE for C# Pin
Stastlivec16-Aug-04 20:31
Stastlivec16-Aug-04 20:31 
GeneralDatagrid Selection Pin
sreejith ss nair16-Aug-04 18:51
sreejith ss nair16-Aug-04 18:51 
QuestionHow to implement a registration key with the following requirement? Pin
ting66816-Aug-04 16:04
ting66816-Aug-04 16:04 
AnswerRe: How to implement a registration key with the following requirement? Pin
Christian Graus16-Aug-04 17:10
protectorChristian Graus16-Aug-04 17:10 
GeneralMS Access Password Pin
Johnnypvan16-Aug-04 13:43
Johnnypvan16-Aug-04 13:43 
GeneralRe: MS Access Password Pin
S Sansanwal16-Aug-04 14:57
S Sansanwal16-Aug-04 14:57 
GeneralRe: MS Access Password Pin
Johnnypvan17-Aug-04 2:10
Johnnypvan17-Aug-04 2:10 
Hi Sanjay,
thanks for your reply, that really gives me some idea of what to look at, but still, cannot really get it work, below is the code I wrote trying to change the password. The first approach didn't throw any exception, but it doesn't work, the database keeps the original password. The second approach throws an exeception "Object or provider is not capable of performing requested operation." of type 'System.Runtime.InteropServices.COMException'. Any idea how to get it work? btw, I've also looked at the JRO one, which seems to work, but haven't tried yet cos some says JRO should be replaced by ADOX, etc.

private void ChangeUserPassword(String strOld, String strNew) {
ADOX.CatalogClass cat = new ADOX.CatalogClass();
ADOX.User user = new ADOX.UserClass();

ADODB.ConnectionClass dbConn = new ADODB.ConnectionClass();
dbConn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password="+strOld+@";Data Source=C:\temp\db1.mdb;Persist Security Info=True";
dbConn.Open(dbConn.ConnectionString, "", "", -1);

cat.ActiveConnection = dbConn;
user.Name="Admin";

//First try
user.ChangePassword(strOld, strNew);

//second try
//cat.Users[user].ChangePassword(strOld, strNew);

Console.WriteLine("password changed");
dbConn.Close();
}

Many thanks.
P
GeneralNtier app Pin
StephenMcAllister16-Aug-04 11:42
StephenMcAllister16-Aug-04 11:42 
Generaldatareader to datagrid Pin
kings_116-Aug-04 11:41
kings_116-Aug-04 11:41 
GeneralRe: datareader to datagrid Pin
S Sansanwal16-Aug-04 15:07
S Sansanwal16-Aug-04 15:07 
GeneralPrint blank page Pin
Titan516-Aug-04 10:34
Titan516-Aug-04 10:34 
GeneralVS 2005 beta - warnings galore Pin
Judah Gabriel Himango16-Aug-04 9:45
sponsorJudah Gabriel Himango16-Aug-04 9:45 
GeneralRe: VS 2005 beta - warnings galore Pin
Nick Parker16-Aug-04 10:13
protectorNick Parker16-Aug-04 10:13 
GeneralRe: VS 2005 beta - warnings galore Pin
Judah Gabriel Himango16-Aug-04 10:50
sponsorJudah Gabriel Himango16-Aug-04 10:50 
GeneralRe: VS 2005 beta - warnings galore Pin
Nick Parker16-Aug-04 10:58
protectorNick Parker16-Aug-04 10:58 
GeneralRe: VS 2005 beta - warnings galore Pin
Judah Gabriel Himango16-Aug-04 11:46
sponsorJudah Gabriel Himango16-Aug-04 11:46 
GeneralRe: VS 2005 beta - warnings galore Pin
LongRange.Shooter17-Aug-04 3:39
LongRange.Shooter17-Aug-04 3:39 
GeneralRe: VS 2005 beta - warnings galore Pin
Judah Gabriel Himango17-Aug-04 4:18
sponsorJudah Gabriel Himango17-Aug-04 4:18 
GeneralGhost windows Pin
Itay Sagui16-Aug-04 9:21
Itay Sagui16-Aug-04 9:21 
GeneralRe: Ghost windows Pin
Nick Parker16-Aug-04 10:03
protectorNick Parker16-Aug-04 10:03 
GeneralRe: Ghost windows Pin
Itay Sagui16-Aug-04 10:11
Itay Sagui16-Aug-04 10:11 
GeneralRe: Ghost windows Pin
Nick Parker16-Aug-04 10:24
protectorNick Parker16-Aug-04 10:24 
Questionusing ReflectionPermission to access Protected members? Pin
LongRange.Shooter16-Aug-04 9:00
LongRange.Shooter16-Aug-04 9:00 
GeneralDrop Down List within a Template Column footer in a DataGrid Pin
spaskewitz16-Aug-04 8:51
spaskewitz16-Aug-04 8:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.