LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to automate MS Access to set Password

Hello Labview Help:

 

I'm trying to automate the setting of new password in Microsoft Access 2003 or 2007 Database Application.

in Labview Activex or Visual Basic. 

01 Microsoft Access Home.jpg

 

 

 

 

 

 

 

 

 

 

 

02 Microsoft Access Database Tools.jpg

 

 

03 Microsoft Access User and Group Accounts.jpg

 

04 Microsoft Access Users.jpg

 

 

Here is where the NEW password would be written.

05 Microsoft Access Change Logon Password.jpg

 

It would be great if you can help or point me to the right place.

 

I tried looking at MSDN info, but quite complicated.

 

The hardest part is how to navigate to the other objects within Microsoft Access with Activex.

 

thank you,

 

diego2000

0 Kudos
Message 1 of 9
(4,361 Views)

If you have the DatabaseConnectivity Toolkit and an open connection to the DB, you should be able to use an Execute Query to modify the password.

 

http://msdn.microsoft.com/en-us/library/bb177884(v=office.12).aspx

 

ALTER USER user PASSWORD newpassword oldpassword

 

0 Kudos
Message 2 of 9
(4,351 Views)

Hi Phillips:

 

Yes, I have the Database Connectivity Toolkit.

 

I will try the command and will report back. It should work.

 

thanks,

 

Diego2000

0 Kudos
Message 3 of 9
(4,341 Views)

Hi Phillip:

 

I have tried what you sugested. Getting close but getting an error.

 

ALTER USER Admin PASSWORD new1 old1.jpg

Looks like I'm missing a file?

 

 

I have also tried the "ALTER DATABASE PASSWORD new1 old1" following command:

 

ALTER DATABSE PASSWORD new1 old1.jpg

 

Thanks for your help,

 

diego2000.

 

0 Kudos
Message 4 of 9
(4,335 Views)
The link I provided had a comment at the bottom stating that the db should be opened exclusively with a mode=12 connection string option. Maybe that would address the error you received.
0 Kudos
Message 5 of 9
(4,332 Views)

Phillip:

 

This is how I'm opening the Access Database. Where would I write the mode=12   ?

 

10 Source Equal 12.jpg

Where would I write the "mode=12" ?

 

 

Provider=Microsoft.ACE.OLEDB.12.0;Persist Security Info=False;Data Source=C:\New3.mdb

 

11 Source Equal 12.jpg

thank you much,

 

diego2000

 

0 Kudos
Message 6 of 9
(4,327 Views)

 

Should be able to add Mode=12; to end of string...

 

From the link:


OleDbConnection objOleDbConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=Sample.mdb; Mode=12");
0 Kudos
Message 7 of 9
(4,325 Views)

Thanks Phillip:

 

I'll try to convert to a Labview statement.

 

diego2000

0 Kudos
Message 8 of 9
(4,306 Views)

Phillip:

 

On second thought, how would you change the password of Access with Visual Basic or VBA?

 

I'm downloading Visual Basic now.

 

thanks,

 

diego2000

0 Kudos
Message 9 of 9
(4,296 Views)