Lm th? no ? m? m?t m?t kh?u b?o v? c s? d? li?u thng qua t? ?ng ha trong Access 2000

D?ch tiu ? D?ch tiu ?
ID c?a bi: 235422 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

? Trang ny

TM T?T

B?ng cch s? d?ng cc OpenCurrentDatabase phng php, b?n c th? l?p tr?nh m? m?t c s? d? li?u Microsoft Access trong giao di?n ng?i dng Microsoft Access. Tuy nhin, cc OpenCurrentDatabase phng php khng cung c?p m?t tham s? ? xc ?nh m?t m?t kh?u cho m?t kh?u b?o v? c s? d? li?u. V? v?y, ng?i s? d?ng t? ?ng nh?c nh?p m?t kh?u c s? d? li?u n?u m?t trong nh?ng t?n t?i.

Bi vi?t ny m t? nh th? no l?p tr?nh m? m?t m?t kh?u b?o v? c s? d? li?u trong Microsoft Access giao di?n ng?i dng m khng c s? can thi?p c?a ng?i dng.

i tng Truy cp D liu (DAO) cho php b?n ch? r? m?t kh?u c s? d? li?u khi m? m?t m?t kh?u b?o v? c s? d? li?u. B?ng cch s? d?ng cc DBEngine b?t ?ng s?n tr?ng h?p c?a Microsoft truy c?p r?ng m? c?a b?n t?o ra, n c th? s? d?ng DAO ? ch? r? m?t kh?u c s? d? li?u. Sau khi c s? d? li?u m?t kh?u ? ?c xc nh?n b?i c s? d? li?u Microsoft Jet cng c?, b?n c th? s? d?ng cc OpenCurrentDatabase phng php ? m? c s? d? li?u trong Microsoft Access ng?i dng giao di?n m khng c s? can thi?p c?a ng?i dng.

V d?-by-step

TH?N TR?NG: N?u b?n lm theo cc b?c trong v d? ny, b?n s?a ?i m?u c s? d? li?u Northwind.mdb. B?n c th? mu?n sao lu cc t?p tin Northwind.mdb v lm theo cc b?c trn m?t b?n sao c?a c s? d? li?u.

  1. B?t ?u Microsoft Access 2000.
  2. M? c s? d? li?u m?u Northwind.mdb cho s? d?ng ?c quy?n. ? m? c s? d? li?u ? s? d?ng ?c quy?n, b?m Northwind.mdb trong cc M? h?p tho?i h?p, b?m vo m?i tn bn c?nh cc M? nt, v sau b?m M? ?c quy?n.
  3. Trn cc Cng cu tr?nh n, i?m ?n Bao mt, v sau nh?p vo Thi?t l?p c s? d? li?u m?t kh?u.
  4. Lo?i nwind trong cc M?t kh?u v Ki?m ch?ng h?p, v sau b?m Ok.
  5. ng c s? d? li?u m?u Northwind.mdb.
  6. M? c s? d? li?u m?u Northwind.mdb ? xc minh r?ng b?n nh?n ?c m?t nh?c ? nh?p d?u nh?c c s? d? li?u.
  7. Nh?p vo H?y b? ? ngn ch?n c s? d? li?u t? khai m?c.
  8. T?o m?t c s? d? li?u m?i, tr?ng.
  9. M? m?t m-un m?i trong thi?t k? giao di?n.
  10. Trn cc Cng cu tr?nh n, nh?p vo Tham khao.
  11. Thm m?t tham chi?u ?n cc Microsoft DAO 3,6 ?i t?ng th vi?n, v sau nh?p vo Ok ? ng nh?ng Tham khao h?p tho?i.
  12. Thm m? sau y ? cc module:
    Option Compare Database
    Option Explicit
    
    Sub OpenPasswordProtectedDB()
    
       'Define as Static so the instance of Access
       'doesn't close when the procedure ends.
       Static acc As Access.Application
       Dim db As DAO.Database
       Dim strDbName As String
       strDbName = "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb"
       Set acc = New Access.Application
       acc.Visible = True
       Set db = acc.DBEngine.OpenDatabase(strDbName, False, False, ";PWD=nwind")
       acc.OpenCurrentDatabase strDbName
       db.Close
       Set db = Nothing
    End Sub
    					
  13. Ch?y chng tr?nh con OpenPasswordProtectedDB trong Immediate c?a s?.
Lu ? r?ng c s? d? li?u Northwind s? m? ra trong tr?ng h?p m?i c?a Microsoft Access m khng c d?u nh?c m?t kh?u.

Sau , b?n c th? mu?n ? xa m?t kh?u c s? d? li?u t? c s? d? li?u m?u Northwind.mdb. ? lm V? v?y, h?y lm theo cc b?c sau:
  1. B?t ?u Microsoft Access 2000.
  2. M? c s? d? li?u m?u Northwind.mdb cho s? d?ng ?c quy?n. ? m? c s? d? li?u ? s? d?ng ?c quy?n, b?m Northwind.mdb trong cc M? h?p tho?i h?p, b?m vo m?i tn bn c?nh cc M? nt, v sau b?m M? ?c quy?n.
  3. Khi nh?c nh?p m?t kh?u c s? d? li?u, g?nwind, v sau nh?p vo Ok.
  4. Trn cc Cng cu tr?nh n, i?m ?n Bao mt, v sau nh?p vo B? ?t c s? d? li?u m?t kh?u.
  5. Khi nh?c nh?p m?t kh?u c s? d? li?u, g?nwind, v sau nh?p vo Ok.
  6. ng c s? d? li?u.
M?t kh?u c s? d? li?u ?c l?y ra.




THAM KH?O

? c thm thng tin v? vi?c m? m?t m?t kh?u c s? d? li?u ?c b?o v? v?i DAO, b?m vo s? bi vi?t d?i y ? xem bi vi?t trong Microsoft Knowledge Base:
209953 ACC2000: Lm th? no ? s? d?ng phng php OpenDatabase ? m? m?t kh?u b?o v? c s? d? li?u









Thu?c tnh

ID c?a bi: 235422 - L?n xem xt sau cng: 17 Thang Chin 2011 - Xem xt l?i: 3.0
p d?ng
  • Microsoft Access 2000 Standard Edition
T? kha:
kbautomation kbprogramming kbhowtomaster kbmt KB235422 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:235422

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com