Berikut ini adalah cara yang digunakan untuk mengganti password file database MS Access melalui VB.
Tambahkan References "Microsoft DAO 3.6 Object Library"
[VB6]
Tambahkan References "Microsoft DAO 3.6 Object Library"
[VB6]
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
Tidak ada komentar:
Posting Komentar