Latest News

Mengganti Password MS Acces Dengan Visual Basic


Berikut ini adalah cara yang digunakan untuk mengganti password database MS Access.
Tambahkan References "Microsoft DAO 3.6 Object Library"

[ VB 6.0 ]
Dim de As New DAO.DBEngine
Dim db As DAO.Database
Dim LokFile As String, Pwd As String

On Error GoTo Ero

LokFile = "Gantikan dengan lokasi file MS Access"
Pwd = "Password Lama"

Set db = de.OpenDatabase(LokFile, True, False, ";pwd=" & Pwd)
db.NewPassword Pwd, "Password Baru"

Exit Sub
Ero:
MsgBox Err.Description


[ VB .NET ]
Dim de As New dao.DBEngine
Dim db As dao.Database
Dim LokFile, Pwd As String

Try
LokFile = "Gantikan dengan lokasi file MS Access"
Pwd = "Password Lama"

db = de.OpenDatabase(LokFile, True, False, ";pwd=" & Pwd)
db.NewPassword(Pwd, "Password Baru")

Catch ex As Exception
MsgBox(ex.Message)
End Try

Post a Comment