Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] - نسخه متنی

Alison Balter

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



Encrypting a Database Using Code


Chapter 27 showed how you can encrypt a database by using the user interface. If a database is not encrypted, it is not really secure because a savvy user can use a disk editor to view the data in the file. If you have distributed your application with the runtime version of Access, and you want to give your user the capability to encrypt the database, you must write ADO code to accomplish the encryption process. The code looks like this:

Sub Encrypt(strDBNotEncrypted As String, strDBEncrypted As String)
Dim je As New JRO.JetEngine
je.CompactDatabase SourceConnection:="Data Source=" _
& strDBNotEncrypted & ";", _
DestConnection:="Data Source=" & strDBEncrypted & _
"; Jet OLEDB:Encrypt Database=True"
End Sub

This subroutine receives two parameters. The first is the name of the database you want to encrypt. The second is the name you want to assign to the encrypted database. The code issues the CompactDatabase method on the JetEngine object. This method receives two parameters: the name of the original database to encrypt and the name for the new encrypted database. Notice that the data source for the destination includes information indicating that you want to encrypt the database being compacted.


/ 544