AutoSlip Posted September 26, 2008 Share Posted September 26, 2008 I can't create a topic in the appropriate section (???), so I try here. This very simple function change the password of an Ms Access Database (tested with access 2000 and access 2002) using DAO 3.6. I'm new to AutoIt, so there are no proper error handling or return code (and correct English). ; Example : Define a password on the database DBChangePassword("E:\base.mdb","","pswd") ; Example : Change the password on the database DBChangePassword("E:\base.mdb","pswd","new") ; Example : reset the password on the database DBChangePassword("E:\base.mdb","new","") ;======================================================================================== ; Change Access Database Password ; The Database must be close by all others applications, because we have to open it in ; Exclusive mode ; ; Parameters : ;(1-i.) Complete Path to the database ;(2-i.) Old Password ("" if no password was defined) ;(3-i.) New Password ("" for no password) ; Return : - ;======================================================================================== Func DBChangePassword($pDBPath, $pOldPswd, $pNewPswd) ;>) Create the "DB Engine", we must specifie the version $dbEng = ObjCreate("DAO.DBEngine.36") ;>) Open database in Exclusive mode $db = $dbEng.Workspaces(0).OpenDatabase($pDBPath,True, False, ";pwd=" & $pOldPswd) ;>) Set the new password $db.NewPassword($pOldPswd, $pNewPswd) ;>) Close the Database $db.Close EndFunc Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 26, 2008 Share Posted September 26, 2008 If you were trying to post in the example scripts forum you have to be a full member. Post a little more then you can or you can ask a mod/admin to move it there for you. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now