Jet 3.0 (32-bit VB4 only) includes a new security system basedon database passwords that you may use instead of the more complex,more secure, workgroup security system. This system allows youto set a single, all-user password to open a database. While muchsimpler to implement and use, this system is very easily compromisedbecause all users use the same password. In addition, it doesn’tlet you track individual user activity in a shared database. However,you can use both workgroup-based security and database passwordsat the same time.
Set a database password in VB using the NewPassword method ofthe database object, using code like this:
Dim wrk As WorkspaceDim dbPwd As DatabaseSet wrk = DBEngine.Workspaces(0)' You must open the database ' exclusively (note 2nd parameter).Set dbPwd = _wrk.OpenDatabase_ ("MyData.MDB", True)' Set the database password which ' currently is blank to "NewPass".dbPwd.NewPassword "","NewPass"