Mengganti Password MS Access
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
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
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
Label: (Menengah), Database, VB .NET, VB 6.0
0 Komentar:
Posting Komentar
Pengunjung yang baik selalu meninggalkan jejak berupa komentar. :)
Berlangganan Posting Komentar [Atom]
<< Beranda